Class: Nonsensor::DateSeries

Inherits:
Object
  • Object
show all
Includes:
Series
Defined in:
lib/nonsensor/date_series.rb

Instance Method Summary collapse

Methods included from Series

#take, #take!, #to_enum

Constructor Details

#initialize(start: Date.today, step: 1) ⇒ DateSeries

Returns a new instance of DateSeries.



6
7
8
9
# File 'lib/nonsensor/date_series.rb', line 6

def initialize(start: Date.today, step: 1)
  @date = start
  @step = step
end

Instance Method Details

#next!Object



11
12
13
14
15
# File 'lib/nonsensor/date_series.rb', line 11

def next!
  date = @date
  @date += @step
  date
end