Module: TinyTemplate::Utils
- Defined in:
- lib/tiny_template.rb
Instance Method Summary collapse
-
#TinyTemplate(str, context = nil) ⇒ Object
Call this method with or without context.
Instance Method Details
#TinyTemplate(str, context = nil) ⇒ Object
Call this method with or without context. If no context is passed, the context of the caller will be computed and passed to a new instance of the class TinyTemplate
58 59 60 61 62 63 64 65 66 |
# File 'lib/tiny_template.rb', line 58 def TinyTemplate(str, context = nil) unless context RubyVM::DebugInspector.open do |inspector| context = eval('self', inspector.frame_binding(2)) end end TinyTemplate.parse(str, context) end |