Class: Magicka::Aggregator::MethodBuilder Private
- Inherits:
-
Sinclair
- Object
- Sinclair
- Magicka::Aggregator::MethodBuilder
- Defined in:
- lib/magicka/aggregator/method_builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible for building an Magicka::Aggregator method
Instance Method Summary collapse
-
#initialize(klass, element_class, method_name = nil) ⇒ MethodBuilder
constructor
private
A new instance of MethodBuilder.
- #prepare ⇒ Object private
Constructor Details
#initialize(klass, element_class, method_name = nil) ⇒ MethodBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MethodBuilder.
9 10 11 12 13 14 |
# File 'lib/magicka/aggregator/method_builder.rb', line 9 def initialize(klass, element_class, method_name = nil) super(klass) @element_class = element_class @method_name = method_name end |
Instance Method Details
#prepare ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/magicka/aggregator/method_builder.rb', line 16 def prepare element_klass = element_class add_method(method_name) do |field, model: self.model, **args| element_klass.render( renderer: renderer, field: field, model: model, **args ) end self end |