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
  %{__already_defined = defined?(json); json||=Props::Template.new(self); #{source};
    json.result! unless (__already_defined && __already_defined != "method")
  }
end