Module: TimeBoss::Calendar::Waypoints::Absolute

Included in:
TimeBoss::Calendar::Waypoints
Defined in:
lib/timeboss/calendar/waypoints/absolute.rb

Instance Method Summary collapse

Instance Method Details

#day(year_index, index) ⇒ Calendar::Day

Get the specified day by index within the specified year.

Parameters:

  • year_index (Integer)

    the year to examine

  • index (Integer)

    the index of the day within the year

Returns:



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.

Parameters:

  • date (Date)

    the date for which to locate the calendar day

Returns:



53
54
55
# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 53

def day_for(date)
  Day.new(self, date)
end

#halfCalendar::Half

Get the specified half by index within the specified year

Parameters:

  • year_index (Integer)

    the year to examine

  • index (Integer)

    the index of the half within the year

Returns:



# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 89


#half_forCalendar::Half

Get the half that contains the specified date.

Parameters:

  • date (Date)

    the date for which to locate the calendar half

Returns:



# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 95


#monthCalendar::Month

Get the specified month by index within the specified year

Parameters:

  • year_index (Integer)

    the year to examine

  • index (Integer)

    the index of the month within the year

Returns:



# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 63


#month_forCalendar::Month

Get the month that contains the specified date.

Parameters:

  • date (Date)

    the date for which to locate the calendar month

Returns:



# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 69


#quarterCalendar::Quarter

Get the specified quarter by index within the specified year

Parameters:

  • year_index (Integer)

    the year to examine

  • index (Integer)

    the index of the quarter within the year

Returns:



# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 76


#quarter_forCalendar::Quarter

Get the quarter that contains the specified date.

Parameters:

  • date (Date)

    the date for which to locate the calendar quarter

Returns:



# 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.

Parameters:

  • year_index (Integer)

    the year to examine

  • index (Integer)

    the index of the week within the year

Returns:



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.

Parameters:

  • date (Date)

    the date for which to locate the calendar week

Returns:



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

#yearCalendar::Year

Get the specified year by index within the specified year

Parameters:

  • year_index (Integer)

    the year to examine

  • index (Integer)

    the index of the year within the year

Returns:



# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 102


#year_forCalendar::Year

Get the year that contains the specified date.

Parameters:

  • date (Date)

    the date for which to locate the calendar year

Returns:



# File 'lib/timeboss/calendar/waypoints/absolute.rb', line 108