Module: HammerBuilder::Helper::ClassMethods
- Defined in:
- lib/hammer_builder/helper.rb
Instance Method Summary (collapse)
-
- (Object) builder(method_name) {|self| ... }
adds instance method to the class.
Instance Method Details
- (Object) builder(method_name) {|self| ... }
adds instance method to the class. Method accepts any instance of builder and returns it after rendering.
26 27 28 29 30 31 |
# File 'lib/hammer_builder/helper.rb', line 26 def builder(method_name, &builder_block) self.builder_methods += [method_name.to_sym] define_method(method_name) do |builder, *args| builder.go_in(self, *args, &builder_block) end end |