Class: Magicka::Helper::MethodBuilder
- Inherits:
-
Sinclair
- Object
- Sinclair
- Magicka::Helper::MethodBuilder
- Defined in:
- lib/magicka/helper/method_builder.rb
Overview
Builds methods for Magicka::Helper
Instance Method Summary collapse
-
#build_aggregator(aggregator_class, type = aggregator_class.type) ⇒ Array<NilClass>
Adds a helper method magicka_
type
.
Instance Method Details
#build_aggregator(aggregator_class, type = aggregator_class.type) ⇒ Array<NilClass>
Adds a helper method magicka_type
The created method executes a block with a an aggragator
8 9 10 11 12 13 14 |
# File 'lib/magicka/helper/method_builder.rb', line 8 def build_aggregator(aggregator_class, type = aggregator_class.type) add_method("magicka_#{type}") do |model, &block| block.call(aggregator_class.new(self, model)) end build end |