Class: RubyTemplate::Handler
- Inherits:
-
Object
- Object
- RubyTemplate::Handler
- Defined in:
- lib/ruby_template/handler.rb
Instance Method Summary collapse
Instance Method Details
#call(template) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/ruby_template/handler.rb', line 9 def call(template) unless File.basename(template.virtual_path).start_with?('_') src = 'ActiveSupport::JSON.encode(code.call)' else src = "code.call" end "code = lambda{#{template.source}};" + "self.output_buffer = (#{src})" end |