Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/finance/interval.rb

Instance Method Summary collapse

Instance Method Details

#monthsInteger

convert an integer value representing months into months

Examples:

360.months #=> 360

Returns:

  • (Integer)

    the number of months



7
8
9
# File 'lib/finance/interval.rb', line 7

def months
  self
end

#yearsInteger

convert an integer value representing years into months

Examples:

30.years #=> 360

Returns:

  • (Integer)

    the number of months



16
17
18
# File 'lib/finance/interval.rb', line 16

def years
  self * 12
end