Gestalt is the custom HTML/XML builder for Ramaze, based on a very simple DSL it will build your markup.
# File lib/ramaze/helper/gestalt.rb, line 14 14: def build(&block) 15: Ramaze::Gestalt.build(&block) 16: end
# 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
# 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
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.