module LucaSupport::Range::ClassMethods

Public Instance Methods

term_by_month(start_date, end_date, step = 1) click to toggle source
# File lib/luca_support/range.rb, line 24
def term_by_month(start_date, end_date, step = 1)
  Enumerator.new do |yielder|
    each_month = start_date
    while each_month <= end_date
      yielder << each_month
      each_month = each_month.next_month(step)
    end
  end
end