class CalendariumRomanum::Util::DateEnumerator

Abstract superclass for date enumerators. @abstract

Attributes

prop[R]
start[R]

Public Instance Methods

==(other) click to toggle source
# File lib/calendarium-romanum/util.rb, line 32
def ==(other)
  self.class == other.class &&
    start == other.start &&
    prop == other.prop
end
each() { |d| ... } click to toggle source

@yield [Date] @return [void, Enumerator]

# File lib/calendarium-romanum/util.rb, line 14
def each
  return to_enum(__method__) unless block_given?

  d = @start
  begin
    yield d
    d = d.succ
  end until enumeration_over? d
end
Also aliased as: each_day
each_day()
Alias for: each
enumeration_over?(date) click to toggle source

@param date [Date] @return [Boolean]

# File lib/calendarium-romanum/util.rb, line 26
def enumeration_over?(date)
  @start.send(@prop) != date.send(@prop)
end