Class: Elibri::ONIX::Release_3_0::StockQuantityCoded

Inherits:
Object
  • Object
show all
Includes:
HashId
Defined in:
lib/elibri_onix/onix_3_0/stock_quantity_coded.rb

Constant Summary collapse

ATTRIBUTES =
[
  :code_type, :code
]
RELATIONS =
[]

Constants included from HashId

HashId::SKIPPED_2, HashId::SKIPPED_ATTRIBS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashId

#calculate_hash, #eid

Constructor Details

#initialize(data) ⇒ StockQuantityCoded

Returns a new instance of StockQuantityCoded.



22
23
24
25
26
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 22

def initialize(data)
  @to_xml = data.to_s
  @code_type = data.at_css('StockQuantityCodeType').try(:text).try(:to_i)
  @code = data.at_css('StockQuantityCode').try(:text)
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



20
21
22
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 20

def code
  @code
end

#code_typeObject

Returns the value of attribute code_type.



20
21
22
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 20

def code_type
  @code_type
end

#to_xmlObject

Returns the value of attribute to_xml.



20
21
22
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 20

def to_xml
  @to_xml
end