Class: Elibri::ONIX::Release_3_0::SalesRestriction
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::SalesRestriction
- Includes:
- HashId
- Defined in:
- lib/elibri_onix/onix_3_0/sales_restriction.rb
Constant Summary collapse
- ATTRIBUTES =
[ :type, :outlet_name, :end_date ]
- RELATIONS =
[]
Constants included from HashId
HashId::SKIPPED_2, HashId::SKIPPED_ATTRIBS
Instance Attribute Summary collapse
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#outlet_name ⇒ Object
Returns the value of attribute outlet_name.
-
#to_xml ⇒ Object
Returns the value of attribute to_xml.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data) ⇒ SalesRestriction
constructor
A new instance of SalesRestriction.
Methods included from HashId
Constructor Details
#initialize(data) ⇒ SalesRestriction
Returns a new instance of SalesRestriction.
24 25 26 27 28 29 30 31 |
# File 'lib/elibri_onix/onix_3_0/sales_restriction.rb', line 24 def initialize(data) @to_xml = data.to_s @type = data.at_xpath('xmlns:SalesRestrictionType').try(:text).try(:to_i) if data.at_xpath('xmlns:SalesOutlet') @outlet_name = data.at_xpath('xmlns:SalesOutlet').at_xpath('xmlns:SalesOutletName').try(:text) end @end_date = Date.parse(data.at_xpath('xmlns:EndDate').try(:text)) if data.at_xpath('xmlns:EndDate') end |
Instance Attribute Details
#end_date ⇒ Object
Returns the value of attribute end_date.
22 23 24 |
# File 'lib/elibri_onix/onix_3_0/sales_restriction.rb', line 22 def end_date @end_date end |
#outlet_name ⇒ Object
Returns the value of attribute outlet_name.
22 23 24 |
# File 'lib/elibri_onix/onix_3_0/sales_restriction.rb', line 22 def outlet_name @outlet_name end |
#to_xml ⇒ Object
Returns the value of attribute to_xml.
22 23 24 |
# File 'lib/elibri_onix/onix_3_0/sales_restriction.rb', line 22 def to_xml @to_xml end |
#type ⇒ Object
Returns the value of attribute type.
22 23 24 |
# File 'lib/elibri_onix/onix_3_0/sales_restriction.rb', line 22 def type @type end |