Class: PackAPI::Mapping::AbstractTransformer
- Inherits:
-
Object
- Object
- PackAPI::Mapping::AbstractTransformer
- Defined in:
- lib/pack_api/mapping/abstract_transformer.rb
Direct Known Subclasses
APIToModelAttributesTransformer, AttributeHashTransformer, ErrorHashToAPIAttributesTransformer, ModelToAPIAttributesTransformer, NullTransformer
Instance Attribute Summary collapse
-
#api_type ⇒ Object
Returns the value of attribute api_type.
-
#data_source ⇒ Object
Returns the value of attribute data_source.
-
#mappings ⇒ Object
Returns the value of attribute mappings.
-
#model_type ⇒ Object
Returns the value of attribute model_type.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #execute ⇒ Object abstract
-
#initialize(config) ⇒ AbstractTransformer
constructor
A new instance of AbstractTransformer.
Constructor Details
#initialize(config) ⇒ AbstractTransformer
Returns a new instance of AbstractTransformer.
8 9 10 11 12 13 14 |
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 8 def initialize(config) @mappings = config[:mappings] @api_type = config[:api_type] @model_type = config[:model_type] @transform_value = config[:transform_value] @options = PackAPI::FrozenEmpty::HASH end |
Instance Attribute Details
#api_type ⇒ Object
Returns the value of attribute api_type.
5 6 7 |
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 5 def api_type @api_type end |
#data_source ⇒ Object
Returns the value of attribute data_source.
5 6 7 |
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 5 def data_source @data_source end |
#mappings ⇒ Object
Returns the value of attribute mappings.
5 6 7 |
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 5 def mappings @mappings end |
#model_type ⇒ Object
Returns the value of attribute model_type.
5 6 7 |
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 5 def model_type @model_type end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 6 def @options end |
Instance Method Details
#execute ⇒ Object
This method is abstract.
18 19 20 |
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 18 def execute raise NotImplementedError end |