Module | Erubis::PrintEnabledEnhancer
In: | erubis/enhancer.rb

enable print function

Notice: use Eruby#evaluate() and don‘t use Eruby#result() to be enable print function.

this is only for Eruby.

### Methods

add_preamble evaluate print

### Public Instance methods

add_preamble(src)

[Source]

    # File erubis/enhancer.rb, line 128
        def add_preamble(src)
          src << "@_buf = "
          super
        end

evaluate(context=nil)

[Source]

    # File erubis/enhancer.rb, line 139
        def evaluate(context=nil)
          _src = @src
          if context.is_a?(Hash)
            context.each do |key, val| instance_variable_set("@#{key}", val) end
          elsif context
            context.instance_variables.each do |name|
              instance_variable_set(name, context.instance_variable_get(name))
            end
          end
          return instance_eval(_src, (@filename || '(erubis)'))
        end

print(*args)

[Source]

    # File erubis/enhancer.rb, line 133
        def print(*args)
          args.each do |arg|
            @_buf << arg.to_s
          end
        end

[Validate]