Class: ONIX::ONIX21::Price

Inherits:
SubsetDSL show all
Defined in:
lib/onix/onix21.rb

Instance Method Summary collapse

Methods inherited from SubsetDSL

get_class, ref_to_short, short_to_ref

Methods inherited from SubsetDSL

_ancestor_registered_scopes, _ancestors_registered_elements, ancestor_registered_scopes, ancestors_registered_elements, element, elements, get_class, #initialize, #parse, ref_to_short, registered_elements, registered_scopes, scope, short_to_ref, #unsupported

Methods inherited from Subset

parse, #parse, tag_match, #tag_match, #unsupported

Constructor Details

This class inherits a constructor from ONIX::SubsetDSL

Instance Method Details

#amountObject



161
162
163
# File 'lib/onix/onix21.rb', line 161

def amount
  @price_amount
end

#currencyObject



165
166
167
# File 'lib/onix/onix21.rb', line 165

def currency
  @currency_code
end

#from_dateObject



181
182
183
184
185
# File 'lib/onix/onix21.rb', line 181

def from_date
  if @price_effective_from
    Date.strptime(@price_effective_from,"%Y%m%d")
  end
end

#including_tax?Boolean

Returns:

  • (Boolean)


173
174
175
176
177
178
179
# File 'lib/onix/onix21.rb', line 173

def including_tax?
  if @price_type_code.human =~/IncludingTax/
    true
  else
    false
  end
end

#qualifierObject



169
170
171
# File 'lib/onix/onix21.rb', line 169

def qualifier
  @price_qualifier
end

#taxObject



197
198
199
# File 'lib/onix/onix21.rb', line 197

def tax
  nil
end

#territoryObject



193
194
195
# File 'lib/onix/onix21.rb', line 193

def territory
  Territory.new(@country_codes)
end

#until_dateObject



187
188
189
190
191
# File 'lib/onix/onix21.rb', line 187

def until_date
  if @price_effective_until
    Date.strptime(@price_effective_until,"%Y%m%d")
  end
end