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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ StockQuantityCoded

Returns a new instance of StockQuantityCoded.



8
9
10
11
12
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 8

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

Instance Attribute Details

#codeObject

Returns the value of attribute code.



6
7
8
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 6

def code
  @code
end

#code_typeObject

Returns the value of attribute code_type.



6
7
8
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 6

def code_type
  @code_type
end

#to_xmlObject

Returns the value of attribute to_xml.



6
7
8
# File 'lib/elibri_onix/onix_3_0/stock_quantity_coded.rb', line 6

def to_xml
  @to_xml
end