Class: Props::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/props_template/handler.rb

Class Method Summary collapse

Class Method Details

.call(template, source = nil) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/props_template/handler.rb', line 8

def self.call(template, source = nil)
  source ||= template.source
  # this juggling is required to keep line numbers right in the error
  %{ __finalize = !defined?(@__json); @__json ||= Props::Template.new(self); json = @__json; #{source};
    json.result! if __finalize
  }
end