Class: ONIX::Price

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

Instance Method Summary collapse

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



26
27
28
# File 'lib/onix/price.rb', line 26

def amount
  @price_amount
end

#currencyObject



34
35
36
# File 'lib/onix/price.rb', line 34

def currency
  @currency_code
end

#datesObject

shortcuts



22
23
24
# File 'lib/onix/price.rb', line 22

def dates
  @price_dates
end

#discountObject



42
43
44
# File 'lib/onix/price.rb', line 42

def discount
  @discount_coded
end

#from_dateObject



46
47
48
49
50
51
52
53
# File 'lib/onix/price.rb', line 46

def from_date
  dt=@price_dates.from_date.first
  if dt
    dt.date
  else
    nil
  end
end

#including_tax?Boolean

Returns:

  • (Boolean)


64
65
66
67
68
69
70
# File 'lib/onix/price.rb', line 64

def including_tax?
  if self.type.human=~/IncludingTax/
    true
  else
    false
  end
end

#qualifierObject



38
39
40
# File 'lib/onix/price.rb', line 38

def qualifier
  @price_qualifier
end

#typeObject



30
31
32
# File 'lib/onix/price.rb', line 30

def type
  @price_type
end

#until_dateObject



55
56
57
58
59
60
61
62
# File 'lib/onix/price.rb', line 55

def until_date
  dt=@price_dates.until_date.first
  if dt
    dt.date
  else
    nil
  end
end