Class: PackAPI::Mapping::AbstractTransformer

Inherits:
Object
  • Object
show all
Defined in:
lib/pack_api/mapping/abstract_transformer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_typeObject

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_sourceObject

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

#mappingsObject

Returns the value of attribute mappings.



5
6
7
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 5

def mappings
  @mappings
end

#model_typeObject

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

#optionsObject

Returns the value of attribute options.



6
7
8
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 6

def options
  @options
end

Instance Method Details

#executeObject

This method is abstract.

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/pack_api/mapping/abstract_transformer.rb', line 18

def execute
  raise NotImplementedError
end