Class: ONIX::SalesRestriction
- Defined in:
- lib/onix/sales_restriction.rb
Instance Attribute Summary collapse
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Instance Method Summary collapse
-
#initialize ⇒ SalesRestriction
constructor
A new instance of SalesRestriction.
- #note ⇒ Object
- #parse(n) ⇒ Object
-
#type ⇒ Object
shortcuts.
Methods inherited from SubsetDSL
_ancestor_registered_scopes, _ancestors_registered_elements, ancestor_registered_scopes, ancestors_registered_elements, element, elements, get_class, ref_to_short, registered_elements, registered_scopes, scope, short_to_ref, #unsupported
Methods inherited from Subset
parse, #tag_match, tag_match, #unsupported
Constructor Details
#initialize ⇒ SalesRestriction
Returns a new instance of SalesRestriction.
19 20 21 |
# File 'lib/onix/sales_restriction.rb', line 19 def initialize @sales_outlets=[] end |
Instance Attribute Details
#end_date ⇒ Object
Returns the value of attribute end_date.
8 9 10 |
# File 'lib/onix/sales_restriction.rb', line 8 def end_date @end_date end |
#start_date ⇒ Object
Returns the value of attribute start_date.
8 9 10 |
# File 'lib/onix/sales_restriction.rb', line 8 def start_date @start_date end |
Instance Method Details
#note ⇒ Object
15 16 17 |
# File 'lib/onix/sales_restriction.rb', line 15 def note @sales_restriction_note end |
#parse(n) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/onix/sales_restriction.rb', line 23 def parse(n) super n.elements.each do |t| case t when tag_match("StartDate") fmt=t["dateformat"] || "00" @start_date=ONIX::Helper.to_date(fmt,t.text) when tag_match("EndDate") fmt=t["dateformat"] || "00" @end_date=ONIX::Helper.to_date(fmt,t.text) end end end |
#type ⇒ Object
shortcuts
11 12 13 |
# File 'lib/onix/sales_restriction.rb', line 11 def type @sales_restriction_type end |