Class: CalendariumRomanum::Util::DateEnumerator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/calendarium-romanum/util.rb

Overview

Abstract superclass for date enumerators.

Direct Known Subclasses

Month, Year

Instance Method Summary collapse

Instance Method Details

#eachObject Also known as: each_day



9
10
11
12
13
14
15
# File 'lib/calendarium-romanum/util.rb', line 9

def each
  d = @start
  begin
    yield d
    d = d.succ
  end until enumeration_over? d
end

#enumeration_over?(date) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/calendarium-romanum/util.rb', line 17

def enumeration_over?(date)
  @start.send(@prop) != date.send(@prop)
end