Class: Sheha::WeeklyEvent
Instance Attribute Summary
Attributes inherited from Event
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #event?(date) ⇒ Boolean
-
#initialize(week_day) ⇒ WeeklyEvent
constructor
A new instance of WeeklyEvent.
- #succ ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(week_day) ⇒ WeeklyEvent
Returns a new instance of WeeklyEvent.
4 5 6 7 |
# File 'lib/sheha/weekly_event.rb', line 4 def initialize(week_day) Sheha::Helper.validate_week_day(week_day) super week_day end |
Instance Method Details
#<=>(other) ⇒ Object
13 14 15 |
# File 'lib/sheha/weekly_event.rb', line 13 def <=>(other) Sheha::Helper.find_week_day_index(week_day) <=> Sheha::Helper.find_week_day_index(other.week_day) end |
#event?(date) ⇒ Boolean
9 10 11 |
# File 'lib/sheha/weekly_event.rb', line 9 def event?(date) week_day == "#{date.strftime('%A').downcase}" end |
#succ ⇒ Object
17 18 19 |
# File 'lib/sheha/weekly_event.rb', line 17 def succ self.class.new succ_week_day end |