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

Attributes

out  [RW] 

Public Class methods

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

@param [Block] 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

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

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

Calls a particular tag based on the specified parameters.

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

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

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

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

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

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

Shortcut for building tags,

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

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]