Class: CalendariumRomanum::Util::DateEnumerator Abstract
- Inherits:
-
Object
- Object
- CalendariumRomanum::Util::DateEnumerator
- Includes:
- Enumerable
- Defined in:
- lib/calendarium-romanum/util.rb
Overview
This class is abstract.
Abstract superclass for date enumerators.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #each {|Date| ... } ⇒ void, Enumerator (also: #each_day)
- #enumeration_over?(date) ⇒ Boolean
Instance Method Details
#==(other) ⇒ Object
32 33 34 35 36 |
# File 'lib/calendarium-romanum/util.rb', line 32 def ==(other) self.class == other.class && start == other.start && prop == other.prop end |
#each {|Date| ... } ⇒ void, Enumerator Also known as: each_day
14 15 16 17 18 19 20 21 22 |
# 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 |
#enumeration_over?(date) ⇒ Boolean
26 27 28 |
# File 'lib/calendarium-romanum/util.rb', line 26 def enumeration_over?(date) @start.send(@prop) != date.send(@prop) end |