Class: Elibri::ONIX::Release_3_0::PriceConstraintLimit
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::PriceConstraintLimit
- Defined in:
- lib/elibri_onix/onix_3_0/price_constraint_limit.rb
Instance Attribute Summary collapse
-
#to_xml ⇒ Object
Returns the value of attribute to_xml.
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ PriceConstraintLimit
constructor
A new instance of PriceConstraintLimit.
Constructor Details
#initialize(data) ⇒ PriceConstraintLimit
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/elibri_onix/onix_3_0/price_constraint_limit.rb', line 8 def initialize(data) @to_xml = data.to_s @unit = data.at_css('PriceConstraintUnit')&.text @value = data.at_css("Quantity")&.text if @unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::VALID_FROM @value = Date.new(@value[0...4].to_i, @value[4...6].to_i, @value[6...8].to_i) else @value = @value.to_i end end |
Instance Attribute Details
#to_xml ⇒ Object
Returns the value of attribute to_xml.
6 7 8 |
# File 'lib/elibri_onix/onix_3_0/price_constraint_limit.rb', line 6 def to_xml @to_xml end |
#unit ⇒ Object
Returns the value of attribute unit.
6 7 8 |
# File 'lib/elibri_onix/onix_3_0/price_constraint_limit.rb', line 6 def unit @unit end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/elibri_onix/onix_3_0/price_constraint_limit.rb', line 6 def value @value end |