Parent

Included Modules

Mab::SimpleBuilder

Public Class Methods

new(assigns = {}, helper = nil, &blk) click to toggle source
# File lib/mab/builder.rb, line 5
def initialize(assigns = {}, helper = nil, &blk)
  @_helper = helper
  @_result = []

  assigns.each do |key, value|
    instance_variable_set(:"@#{key}", value)
  end

  if helper
    helper.instance_variables.each do |var|
      instance_variable_set(var, helper.instance_variable_get(var))
    end
  end

  capture(&blk) if blk
end

Public Instance Methods

capture(&blk) click to toggle source
# File lib/mab/builder.rb, line 22
def capture(&blk)
  @_result << mab(&blk)
end
method_missing(name, *args, &blk) click to toggle source
# File lib/mab/builder.rb, line 28
def method_missing(name, *args, &blk)
  if @_helper && @_helper.respond_to?(name, true)
    @_helper.send(name, *args, &blk)
  else
    super
  end
end
to_s() click to toggle source
# File lib/mab/builder.rb, line 26
def to_s; @_result.join end

[Validate]

Generated with the Darkfish Rdoc Generator 2.