class TimeRange::MonthEnumerator

Public Class Methods

new(range, step) click to toggle source
# File lib/3scale_time_range.rb, line 164
def initialize(range, step)
  @range = range
end

Public Instance Methods

each() { |current| ... } click to toggle source
# File lib/3scale_time_range.rb, line 168
def each
  current = @range.begin
  last = @range.end
  last -= 1.month if @range.exclude_end?

  while current <= last
    yield(current)
    current = (current + 1.month).end_of_month
  end

  self
end