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.
45 46 47 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 45 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.
52 53 54 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 52 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 88
|
#half_for ⇒ Calendar::Half
Get the half that contains the specified date.
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 94
|
#month ⇒ Calendar::Month
Get the specified month by index within the specified year
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 62
|
#month_for ⇒ Calendar::Month
Get the month that contains the specified date.
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 68
|
#quarter ⇒ Calendar::Quarter
Get the specified quarter by index within the specified year
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 75
|
#quarter_for ⇒ Calendar::Quarter
Get the quarter that contains the specified date.
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 81
|
#week(year_index, index) ⇒ Calendar::Week
Get the specified week by index within the specified year.
30 31 32 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 30 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.
37 38 39 |
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 37 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 101
|
#year_for ⇒ Calendar::Year
Get the year that contains the specified date.
|
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 107
|