Class: Triplet::Template

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/triplet/template.rb

Constant Summary

Constants included from DSL

DSL::TAGS, DSL::VOID_TAGS

Instance Method Summary collapse

Methods included from DSL

#render_triplet

Constructor Details

#initialize(output_buffer = ActionView::OutputBuffer.new, &block) ⇒ Template

Returns a new instance of Template.



7
8
9
10
11
# File 'lib/triplet/template.rb', line 7

def initialize(output_buffer = ActionView::OutputBuffer.new, &block)
  @output_buffer = output_buffer

  @output_buffer << render_triplet(instance_eval(&block))
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/triplet/template.rb', line 13

def to_s
  @output_buffer.to_s
end