Class | Ramaze::Gestalt
In: | lib/ramaze/gestalt.rb
Parent: | Object

Gestalt is the custom HTML/XML builder for Ramaze, based on a very simple DSL it will build your markup.

@example

      html =
        Gestalt.build do
          html do
            head do
              title "Hello, World!"
            end
            body do
              h1 "Hello, World!"
            end
          end
        end

### Methods

_gestalt_build_tag _gestalt_call_tag _gestalt_escape_entities build method_missing new p select tag to_s to_str

### Attributes

out | [RW] |

### Public Class methods

build(&block)

The default way to start building your markup. Takes a block and returns the markup.

@param [Block] block

new(&block)

Gestalt.new is like ::build but will return itself. you can either access out or .to_s it, which will return the actual markup.

Useful for distributed building of one page.

@param [Block] block

### Public Instance methods

_gestalt_build_tag(name, attr = {}, text = []) {|| ...}

Build a tag for `name`, using `args` and an optional block that will be yielded.

@param [String] name @param [Hash] attr @param [Hash] text

_gestalt_call_tag(name, args, &block)

Calls a particular tag based on the specified parameters.

@param [String] name @param [Hash] args @param [Block] block

_gestalt_escape_entities(s)

Replace common HTML characters such as " and < with their entities.

@param [String] s The HTML string that needs to be escaped.

method_missing(meth, *args, &block)

Catching all the tags. passing it to _gestalt_build_tag

@param [String] method The method that was called. @param [Hash] args Additional arguments passed to the called method. @param [Block] block

p(*args, &block)

Workaround for Kernel#p to make <p /> tags possible.

@param [Hash] args Extra arguments that should be processed before

     creating the paragraph tag.

@param [Block] block

select(*args, &block)

Workaround for Kernel#select to make <select></select> work.

@param [Hash] args Extra arguments that should be processed before

     creating the select tag.

@param [Block] block

tag(name, *args, &block)

Shortcut for building tags,

@param [String] name @param [Hash] args @param [Block] block

to_s()

Convert the final output of Gestalt to a string. This method has the following alias: "to_str".

@return [String]

to_str()

Alias for to_s

[Validate]