Class: Mab::SimpleBuilder

### Home Classes Methods

### In Files

- lib/mab/builder.rb

### Parent

Object

### Methods

- ::new
- #capture
- #method_missing
- #to_s

### Included Modules

- Mab::Mixin

### Class/Module Index

Quicksearch

- Mab
- Mab::Builder
- Mab::Indentation
- Mab::Mixin
- Mab::Mixin::Context
- Mab::Mixin::Error
- Mab::Mixin::HTML5
- Mab::Mixin::HTMLDefiners
- Mab::Mixin::Tag
- Mab::Mixin::XHTML5
- Mab::Mixin::XML
- Mab::PrettyBuilder
- Mab::RailsBuilder
- Mab::RailsHandler
- Mab::SimpleBuilder
- Object

No matching classes.

# 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.