Class: Hanami::Model::Plugins::Mapping::InputWithMapping Private
- Inherits:
-
WrappingInput
- Object
- WrappingInput
- Hanami::Model::Plugins::Mapping::InputWithMapping
- Defined in:
- lib/hanami/model/plugins/mapping.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.
Takes the output and applies the transformations
Instance Method Summary collapse
-
#[](value) ⇒ Object
private
Processes the output.
-
#initialize(relation, input) ⇒ InputWithMapping
constructor
private
A new instance of InputWithMapping.
Constructor Details
#initialize(relation, input) ⇒ InputWithMapping
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 InputWithMapping.
18 19 20 21 |
# File 'lib/hanami/model/plugins/mapping.rb', line 18 def initialize(relation, input) super @mapping = Hanami::Model.configuration.mappings[relation.name.to_sym] end |
Instance Method Details
#[](value) ⇒ 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.
Processes the output
27 28 29 |
# File 'lib/hanami/model/plugins/mapping.rb', line 27 def [](value) @input[@mapping.process(value)] end |