Class: JbuilderHandler

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

Class Method Summary collapse

Class Method Details

.call(template) ⇒ Object



49
50
51
52
53
# File 'lib/jbuilder_template.rb', line 49

def self.call(template)
  # this juggling is required to keep line numbers right in the error
  %{__already_defined = defined?(json); json||=JbuilderTemplate.new(self); #{template.source}
    json.target! unless __already_defined}
end