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

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

Instance Method Summary collapse

Instance Method Details

#_builder_buffer(the_binding) ⇒ Object



32
33
34
# File 'lib/merb-builder/template.rb', line 32

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


52
53
54
# File 'lib/merb-builder/template.rb', line 52

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

#concat_builder(string, binding) ⇒ Object



56
57
58
# File 'lib/merb-builder/template.rb', line 56

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