Class: ONIX::ONIX21::Price
Instance Attribute Summary
Attributes included from Attributes
#attributes
Instance Method Summary
collapse
Methods inherited from SubsetDSL
#get_class, ref_to_short, short_to_ref
Methods inherited from SubsetDSL
element, elements, #get_class, get_class, inherited, #initialize, n, #parse, ref_to_short, register_elements, register_scopes, #register_subset_array, registered_elements, #registered_elements, registered_scopes, scope, short_to_ref
Methods inherited from Subset
parse, #parse, #tag_match, #unsupported
Methods included from Attributes
attribute_class, #parse_attributes, #serialized_attributes
Instance Method Details
#amount ⇒ Float
135
136
137
138
|
# File 'lib/onix/onix21.rb', line 135
element "PriceAmount", :float, {
:shortcut => :amount,
:parse_lambda => lambda { |v| (v * 100).round }
}
|
#country_codes ⇒ Array<String>
142
|
# File 'lib/onix/onix21.rb', line 142
elements "CountryCode", :text
|
#currency ⇒ String
141
|
# File 'lib/onix/onix21.rb', line 141
element "CurrencyCode", :text, :shortcut => :currency
|
#currency_code ⇒ String
141
|
# File 'lib/onix/onix21.rb', line 141
element "CurrencyCode", :text, :shortcut => :currency
|
140
|
# File 'lib/onix/onix21.rb', line 140
element "DiscountCoded", :subset
|
#from_date ⇒ Object
154
155
156
157
158
|
# File 'lib/onix/onix21.rb', line 154
def from_date
if @price_effective_from
Date.strptime(@price_effective_from, "%Y%m%d")
end
end
|
#including_tax? ⇒ Boolean
146
147
148
149
150
151
152
|
# File 'lib/onix/onix21.rb', line 146
def including_tax?
if @price_type_code.human =~ /IncludingTax/
true
else
false
end
end
|
#price_amount ⇒ Float
135
136
137
138
|
# File 'lib/onix/onix21.rb', line 135
element "PriceAmount", :float, {
:shortcut => :amount,
:parse_lambda => lambda { |v| (v * 100).round }
}
|
#price_effective_from ⇒ String
143
|
# File 'lib/onix/onix21.rb', line 143
element "PriceEffectiveFrom", :text
|
#price_effective_until ⇒ String
144
|
# File 'lib/onix/onix21.rb', line 144
element "PriceEffectiveUntil", :text
|
139
|
# File 'lib/onix/onix21.rb', line 139
element "PriceQualifier", :subset, :shortcut => :qualifier
|
#price_type_code ⇒ PriceTypeCode
134
|
# File 'lib/onix/onix21.rb', line 134
element "PriceTypeCode", :subset, :klass => "PriceType"
|
139
|
# File 'lib/onix/onix21.rb', line 139
element "PriceQualifier", :subset, :shortcut => :qualifier
|
#tax ⇒ Object
170
171
172
|
# File 'lib/onix/onix21.rb', line 170
def tax
nil
end
|
#territory ⇒ Object
166
167
168
|
# File 'lib/onix/onix21.rb', line 166
def territory
Territory.new(@country_codes)
end
|
#until_date ⇒ Object
160
161
162
163
164
|
# File 'lib/onix/onix21.rb', line 160
def until_date
if @price_effective_until
Date.strptime(@price_effective_until, "%Y%m%d")
end
end
|