Class: FTF::Mappings::Product

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, file) ⇒ Product

Returns a new instance of Product.



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

def initialize(data, file)
  @data = data
  @file = file
  @holders = @data[:holders].map { |holder| Holder.new(holder, self) }
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



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

def file
  @file
end

#holdersObject (readonly)

Returns the value of attribute holders.



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

def holders
  @holders
end

Instance Method Details

#actionObject



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

def action
  @data[:action]
end

#canceled_atObject



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

def canceled_at
  @data[:canceled_at]
end

#created_atObject



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

def created_at
  @data[:created_at]
end

#idObject



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

def id
  @data[:id]
end

#id_typeObject



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

def id_type
  @data[:id_type]
end

#lease_periodObject



54
55
56
# File 'lib/ftf/mappings/product.rb', line 54

def lease_period
  @data[:lease_period]
end

#lease_typeObject



50
51
52
# File 'lib/ftf/mappings/product.rb', line 50

def lease_type
  @data[:lease_type]
end

#render(index) ⇒ Object



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

def render(index)
  Records::Product.new(index, self).render
end

#transfered_atObject



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

def transfered_at
  @data[:transfered_at]
end

#transfered_entity_idObject



46
47
48
# File 'lib/ftf/mappings/product.rb', line 46

def transfered_entity_id
  @data[:transfered_entity_id]
end

#typeObject



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

def type
  @data[:type]
end