Module | Erubis::PrintEnabledEnhancer |
In: |
lib/erubis/enhancer.rb
|
# File lib/erubis/enhancer.rb, line 128 128: def add_preamble(src) 129: src << "@_buf = " 130: super 131: end
# File lib/erubis/enhancer.rb, line 139 139: def evaluate(context=nil) 140: _src = @src 141: if context.is_a?(Hash) 142: context.each do |key, val| instance_variable_set("@#{key}", val) end 143: elsif context 144: context.instance_variables.each do |name| 145: instance_variable_set(name, context.instance_variable_get(name)) 146: end 147: end 148: return instance_eval(_src, (@filename || '(erubis)')) 149: end