Module: Merb::Template::Builder::Mixin

Defined in:
lib/merb-builder/template.rb

Instance Method Summary collapse

Instance Method Details

#_builder_buffer(the_binding) ⇒ Object



39
40
41
# File 'lib/merb-builder/template.rb', line 39

def _builder_buffer(the_binding)
  @_buffer = eval("xml", the_binding, __FILE__, __LINE__)
end

#capture_builder(*args, &block) ⇒ Object

Parameters

*args

Arguments to pass to the block.

&block

The template block to call.

Returns

String

The output of the block.

Examples

Capture being used in a .html.erb page:

@foo = capture do
  xml.instruct!
  xml.foo do
    xml.bar "baz"
  end
  xml.target!
end


59
60
61
# File 'lib/merb-builder/template.rb', line 59

def capture_builder(*args, &block)
  block.call(*args)
end

#concat_builder(string, binding) ⇒ Object



63
64
65
# File 'lib/merb-builder/template.rb', line 63

def concat_builder(string, binding)
  _builder_buffer(binding) << string
end