Class: Datanorm::Lines::V4::Extra
- Inherits:
-
Base
- Object
- Base
- Datanorm::Lines::V4::Extra
show all
- Defined in:
- lib/datanorm/lines/v4/extra.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#columns, #source_line_number
Instance Method Summary
collapse
Methods inherited from Base
#encode, inherited, #initialize, #record_kind, #to_json
Instance Method Details
#alternative_id ⇒ Object
37
38
39
|
# File 'lib/datanorm/lines/v4/extra.rb', line 37
def alternative_id
encode columns[4]
end
|
#as_json ⇒ Object
49
50
51
|
# File 'lib/datanorm/lines/v4/extra.rb', line 49
def as_json
{ alternative_id:, matchcode:, ean:, category_id: }
end
|
#category_id ⇒ Object
45
46
47
|
# File 'lib/datanorm/lines/v4/extra.rb', line 45
def category_id
encode columns[11]
end
|
#ean ⇒ Object
41
42
43
|
# File 'lib/datanorm/lines/v4/extra.rb', line 41
def ean
encode columns[9]
end
|
#id ⇒ Object
28
29
30
|
# File 'lib/datanorm/lines/v4/extra.rb', line 28
def id
encode columns[2]
end
|
#matchcode ⇒ Object
This is like a tag. E.g. a product category.
33
34
35
|
# File 'lib/datanorm/lines/v4/extra.rb', line 33
def matchcode
encode columns[3].to_s.strip
end
|
#to_s ⇒ Object
24
25
26
|
# File 'lib/datanorm/lines/v4/extra.rb', line 24
def to_s
"EXTRA [#{id}] #{"{#{matchcode}}" unless matchcode.empty?} EAN: #{ean}"
end
|