def render(scope = Object.new, locals = {}, &block)
      # Get opulent buffer value
      if scope.instance_variable_defined?(:@_opulent_buffer)
        initial_buffer = scope.instance_variable_get(:@_opulent_buffer)
      else
        initial_buffer = []
      end

      # If a layout is set, get the specific layout, otherwise, set the default
      # one. If a layout is set to false, the page will be render as it is.
      if scope.is_a? binding.class
        scope_object = eval 'self', scope
        scope = scope_object.instance_eval { binding } if block_given?
      else
        scope_object = scope
        scope = scope_object.instance_eval { binding }
      end

      # Set input local variables in current scope
      if scope.respond_to? :local_variable_set
        locals.each do |key, value|
          scope.local_variable_set key, value
        end
      else
        locals.each do |key, value|
          eval("#{key} = nil; lambda {|v| #{key} = v}", scope).call(value)
        end
      end

      # Evaluate the template in the given scope (context)
      begin
        eval @src, scope
      rescue ::SyntaxError => e
        raise SyntaxError, e.message
      ensure
        # Get rid of the current buffer
        scope_object.instance_variable_set :@_opulent_buffer, initial_buffer
      end
    end
def render(scope = Object.new, locals = {}, &block)
      # Get opulent buffer value
      if scope.instance_variable_defined?(:@_opulent_buffer)
        initial_buffer = scope.instance_variable_get(:@_opulent_buffer)
      else
        initial_buffer = []
      end

      # If a layout is set, get the specific layout, otherwise, set the default
      # one. If a layout is set to false, the page will be render as it is.
      if scope.is_a? binding.class
        scope_object = eval 'self', scope
        scope = scope_object.instance_eval { binding } if block_given?
      else
        scope_object = scope
        scope = scope_object.instance_eval { binding }
      end

      # Set input local variables in current scope
      if scope.respond_to? :local_variable_set
        locals.each do |key, value|
          scope.local_variable_set key, value
        end
      else
        locals.each do |key, value|
          eval("#{key} = nil; lambda {|v| #{key} = v}", scope).call(value)
        end
      end

      # Evaluate the template in the given scope (context)
      begin
        eval @src, scope
      rescue ::SyntaxError => e
        raise SyntaxError, e.message
      ensure
        # Get rid of the current buffer
        scope_object.instance_variable_set :@_opulent_buffer, initial_buffer
      end
    end
Update render settings

 @param input [Symbol/String] Input code or file
 @param settings [Hash] Opulent settings override

 Avoid code duplication when layouting is set. When we have a layout, look
 in layouts/application by default.

 @param scope [Object] Template evaluation context
 @param locals [Hash] Render call local variables
 @param block [Proc] Processing environment data