Module: Magicka::Aggregator::ClassMethods
- Included in:
- Magicka::Aggregator
- Defined in:
- lib/magicka/aggregator/class_methods.rb
Overview
Class methods for Magicka::Aggregator
Instance Method Summary collapse
-
#type(new_type = nil) ⇒ Symbol
Set and return the type of the aggregator.
-
#with_element(element_class, method_name = nil, template: nil) ⇒ Array<NilClass>
Configure an Magicka::Aggregator adding a method to render an element.
Instance Method Details
#type(new_type = nil) ⇒ Symbol
Set and return the type of the aggregator
When new_type is ommited, returns the last value
22 23 24 25 26 |
# File 'lib/magicka/aggregator/class_methods.rb', line 22 def type(new_type = nil) return @type ||= default_type unless new_type @type = new_type.to_sym end |
#with_element(element_class, method_name = nil, template: nil) ⇒ Array<NilClass> #with_element(element_class_name, method_name = nil, template: nil) ⇒ Array<NilClass>
Configure an Magicka::Aggregator adding a method to render an element
8 9 10 11 12 13 |
# File 'lib/magicka/aggregator/class_methods.rb', line 8 def with_element(element_class, method_name = nil, template: nil) MethodBuilder .new(self, element_class, method_name, template: template) .prepare .build end |