Class: FTF::Mappings::Holder

Inherits:
Object
  • Object
show all
Defined in:
lib/ftf/mappings/holder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, product) ⇒ Holder

Returns a new instance of Holder.



8
9
10
11
12
# File 'lib/ftf/mappings/holder.rb', line 8

def initialize(data, product)
  @data = data
  @product = product
  @relationships = @data[:relationships].map { |relationship| Relationship.new(relationship, self) }
end

Instance Attribute Details

#productObject (readonly)

Returns the value of attribute product.



6
7
8
# File 'lib/ftf/mappings/holder.rb', line 6

def product
  @product
end

#relationshipsObject (readonly)

Returns the value of attribute relationships.



6
7
8
# File 'lib/ftf/mappings/holder.rb', line 6

def relationships
  @relationships
end

Instance Method Details

#actionObject



14
15
16
# File 'lib/ftf/mappings/holder.rb', line 14

def action
  @data[:action]
end

#created_atObject



30
31
32
# File 'lib/ftf/mappings/holder.rb', line 30

def created_at
  @data[:created_at]
end

#expedition_countryObject



34
35
36
# File 'lib/ftf/mappings/holder.rb', line 34

def expedition_country
  @data[:expedition_country]
end

#idObject



26
27
28
# File 'lib/ftf/mappings/holder.rb', line 26

def id
  @data[:id]
end

#id_typeObject



22
23
24
# File 'lib/ftf/mappings/holder.rb', line 22

def id_type
  @data[:id_type]
end

#nameObject



18
19
20
# File 'lib/ftf/mappings/holder.rb', line 18

def name
  @data[:name]
end

#nationality_countryObject



38
39
40
# File 'lib/ftf/mappings/holder.rb', line 38

def nationality_country
  @data[:nationality_country]
end

#residence_countryObject



42
43
44
# File 'lib/ftf/mappings/holder.rb', line 42

def residence_country
  @data[:residence_country]
end