Class: Elibri::ONIX::Release_3_0::StockQuantityCoded
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::StockQuantityCoded
- 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
-
#code ⇒ Object
Returns the value of attribute code.
-
#code_type ⇒ Object
Returns the value of attribute code_type.
-
#to_xml ⇒ Object
Returns the value of attribute to_xml.
Instance Method Summary collapse
-
#initialize(data) ⇒ StockQuantityCoded
constructor
A new instance of StockQuantityCoded.
Methods included from HashId
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
#code ⇒ Object
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_type ⇒ Object
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_xml ⇒ Object
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 |