Module: TimeBoss::Calendar::Waypoints::Absolute
- Included in:
- TimeBoss::Calendar::Waypoints
- Defined in:
- lib/timeboss/calendar/waypoints/absolute.rb
Instance Method Summary collapse
-
#day(year_index, index) ⇒ Calendar::Day
Get the specified day by index within the specified year.
-
#day_for(date) ⇒ Calendar::Day
Get the day that contains the specified date.
-
#half ⇒ Calendar::Half
Get the specified half by index within the specified year.
-
#half_for ⇒ Calendar::Half
Get the half that contains the specified date.
-
#month ⇒ Calendar::Month
Get the specified month by index within the specified year.
-
#month_for ⇒ Calendar::Month
Get the month that contains the specified date.
-
#quarter ⇒ Calendar::Quarter
Get the specified quarter by index within the specified year.
-
#quarter_for ⇒ Calendar::Quarter
Get the quarter that contains the specified date.
-
#week(year_index, index) ⇒ Calendar::Week
Get the specified week by index within the specified year.
-
#week_for(date) ⇒ Calendar::Week
Get the week that contains the specified date.
-
#year ⇒ Calendar::Year
Get the specified year by index within the specified year.
-
#year_for ⇒ Calendar::Year
Get the year that contains the specified date.
Instance Method Details
#day(year_index, index) ⇒ Calendar::Day
Get the specified day by index within the specified year.
46 47 48 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 46 def day(year_index, index) year(year_index).days[index - 1] end |
#day_for(date) ⇒ Calendar::Day
Get the day that contains the specified date.
53 54 55 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 53 def day_for(date) Day.new(self, date) end |
#half ⇒ Calendar::Half
Get the specified half by index within the specified year
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 89
|
#half_for ⇒ Calendar::Half
Get the half that contains the specified date.
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 95
|
#month ⇒ Calendar::Month
Get the specified month by index within the specified year
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 63
|
#month_for ⇒ Calendar::Month
Get the month that contains the specified date.
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 69
|
#quarter ⇒ Calendar::Quarter
Get the specified quarter by index within the specified year
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 76
|
#quarter_for ⇒ Calendar::Quarter
Get the quarter that contains the specified date.
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 82
|
#week(year_index, index) ⇒ Calendar::Week
Get the specified week by index within the specified year.
31 32 33 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 31 def week(year_index, index) year(year_index).weeks[index - 1] end |
#week_for(date) ⇒ Calendar::Week
Get the week that contains the specified date.
38 39 40 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 38 def week_for(date) year_for(date).weeks.find { |w| w.to_range.include?(date) } end |
#year ⇒ Calendar::Year
Get the specified year by index within the specified year
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 102
|
#year_for ⇒ Calendar::Year
Get the year that contains the specified date.
|
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 108
|