class FortuneTeller::InflatingInt
An integer that inflates with time
Public Class Methods
new(int:, start_date:)
click to toggle source
# File lib/fortuneteller/inflating_int.rb, line 4 def initialize(int:, start_date:) @int = int @start_date = start_date end
Public Instance Methods
on(date)
click to toggle source
# File lib/fortuneteller/inflating_int.rb, line 9 def on(date) (@int * 1.02**(date.year - @start_date.year)).floor end