Class Index [+]

Quicksearch

Ramaze::Helper::Gestalt

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

Constants

CACHE_G

Public Instance Methods

build(&block) click to toggle source
    # File lib/ramaze/helper/gestalt.rb, line 14
14:       def build(&block)
15:         Ramaze::Gestalt.build(&block)
16:       end
g(meth = nil, view = nil) click to toggle source
    # File lib/ramaze/helper/gestalt.rb, line 18
18:       def g(meth = nil, view = nil)
19:         meth ||= caller[0].slice(/`(.*)'?/).gsub(/[\`\']/, '')
20:         view_name = (self.class.to_s.sub('Controller', '') + 'View').split('::')
21:         view ||= view_name.inject(Object){ |ns, name| ns.const_get(name) }
22: 
23:         gestalt_class = CACHE_G[view] ||= g_class
24:         gestalt = gestalt_class.new
25:         gestalt.extend(view)
26:         instance_variables.each do |iv|
27:           gestalt.instance_variable_set(iv, instance_variable_get(iv))
28:         end
29:         gestalt.__send__(meth)
30:         gestalt.to_s
31:       end
g_class() click to toggle source
    # File lib/ramaze/helper/gestalt.rb, line 33
33:       def g_class
34:         ancs = self.class.ancestors
35:         helpers = Ramaze::Helper.constants.map{ |c| Ramaze::Helper.const_get(c)}
36:         our_helpers = ancs & helpers
37:         our_helpers.delete(Ramaze::Helper::Gestalt)
38:         gestalt_class = Class.new(Ramaze::Gestalt){ include(*our_helpers) }
39:       end
gestalt(&block) click to toggle source
    # File lib/ramaze/helper/gestalt.rb, line 10
10:       def gestalt(&block)
11:         Ramaze::Gestalt.new(&block)
12:       end
method_missing(sym, *args, &block) click to toggle source
    # File lib/ramaze/helper/gestalt.rb, line 41
41:       def method_missing(sym, *args, &block)
42:         @gestalt ||= gestalt
43:         @gestalt.send(sym, *args, &block)
44:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.