Module: TimeBoss::Calendar::Support::Shiftable

Included in:
Unit
Defined in:
lib/timeboss/calendar/support/shiftable.rb

Instance Method Summary collapse

Instance Method Details

#days_agoCalendar::Day?

Get the index-relative day some number of days ago. Returns nil if no single day can be identified.

Parameters:

  • offset (Integer)

    the number of days back to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 43

#days_aheadCalendar::Day?

Get the index-relative day some number of days ahead. Returns nil if no single day can be identified.

Parameters:

  • offset (Integer)

    the number of days forward to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 49

#halves_agoCalendar::Half?

Get the index-relative half some number of halves ago. Returns nil if no single half can be identified.

Parameters:

  • offset (Integer)

    the number of halves back to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 179

#halves_aheadCalendar::Half?

Get the index-relative half some number of halves ahead. Returns nil if no single half can be identified.

Parameters:

  • offset (Integer)

    the number of halves forward to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 185

#in_dayInteger?

Get the index within the day that this unit falls in. Returns nil if no single day can be identified.

Returns:

  • (Integer, nil)


# File 'lib/timeboss/calendar/support/shiftable.rb', line 38

#in_halfInteger?

Get the index within the half that this unit falls in. Returns nil if no single half can be identified.

Returns:

  • (Integer, nil)


# File 'lib/timeboss/calendar/support/shiftable.rb', line 174

#in_monthInteger?

Get the index within the month that this unit falls in. Returns nil if no single month can be identified.

Returns:

  • (Integer, nil)


# File 'lib/timeboss/calendar/support/shiftable.rb', line 106

#in_quarterInteger?

Get the index within the quarter that this unit falls in. Returns nil if no single quarter can be identified.

Returns:

  • (Integer, nil)


# File 'lib/timeboss/calendar/support/shiftable.rb', line 140

#in_weekInteger?

Get the index within the week that this unit falls in. Returns nil if no single week can be identified.

Returns:

  • (Integer, nil)


# File 'lib/timeboss/calendar/support/shiftable.rb', line 72

#in_yearInteger?

Get the index within the year that this unit falls in. Returns nil if no single year can be identified.

Returns:

  • (Integer, nil)


# File 'lib/timeboss/calendar/support/shiftable.rb', line 208

#last_dayCalendar::Day? Also known as: yesterday

Get the index-relative day 1 day ago. Returns nil if no single day can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 55

#last_halfCalendar::Half?

Get the index-relative half 1 half ago. Returns nil if no single half can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 191

#last_monthCalendar::Month?

Get the index-relative month 1 month ago. Returns nil if no single month can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 123

#last_quarterCalendar::Quarter?

Get the index-relative quarter 1 quarter ago. Returns nil if no single quarter can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 157

#last_weekCalendar::Week?

Get the index-relative week 1 week ago. Returns nil if no single week can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 89

#last_yearCalendar::Year?

Get the index-relative year 1 year ago. Returns nil if no single year can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 225

#months_agoCalendar::Month?

Get the index-relative month some number of months ago. Returns nil if no single month can be identified.

Parameters:

  • offset (Integer)

    the number of months back to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 111

#months_aheadCalendar::Month?

Get the index-relative month some number of months ahead. Returns nil if no single month can be identified.

Parameters:

  • offset (Integer)

    the number of months forward to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 117

#next_dayCalendar::Day? Also known as: tomorrow

Get the index-relative day 1 day forward. Returns nil if no single day can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 65

#next_halfCalendar::Half?

Get the index-relative half 1 half forward. Returns nil if no single half can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 201

#next_monthCalendar::Month?

Get the index-relative month 1 month forward. Returns nil if no single month can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 133

#next_quarterCalendar::Quarter?

Get the index-relative quarter 1 quarter forward. Returns nil if no single quarter can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 167

#next_weekCalendar::Week?

Get the index-relative week 1 week forward. Returns nil if no single week can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 99

#next_yearCalendar::Year?

Get the index-relative year 1 year forward. Returns nil if no single year can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 235

#quarters_agoCalendar::Quarter?

Get the index-relative quarter some number of quarters ago. Returns nil if no single quarter can be identified.

Parameters:

  • offset (Integer)

    the number of quarters back to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 145

#quarters_aheadCalendar::Quarter?

Get the index-relative quarter some number of quarters ahead. Returns nil if no single quarter can be identified.

Parameters:

  • offset (Integer)

    the number of quarters forward to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 151

#this_dayCalendar::Day? Also known as: today

Get the index-relative day for this day. Returns nil if no single day can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 60

#this_halfCalendar::Half?

Get the index-relative half for this half. Returns nil if no single half can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 196

#this_monthCalendar::Month?

Get the index-relative month for this month. Returns nil if no single month can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 128

#this_quarterCalendar::Quarter?

Get the index-relative quarter for this quarter. Returns nil if no single quarter can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 162

#this_weekCalendar::Week?

Get the index-relative week for this week. Returns nil if no single week can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 94

#this_yearCalendar::Year?

Get the index-relative year for this year. Returns nil if no single year can be identified.

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 230

#weeks_agoCalendar::Week?

Get the index-relative week some number of weeks ago. Returns nil if no single week can be identified.

Parameters:

  • offset (Integer)

    the number of weeks back to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 77

#weeks_aheadCalendar::Week?

Get the index-relative week some number of weeks ahead. Returns nil if no single week can be identified.

Parameters:

  • offset (Integer)

    the number of weeks forward to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 83

#years_agoCalendar::Year?

Get the index-relative year some number of years ago. Returns nil if no single year can be identified.

Parameters:

  • offset (Integer)

    the number of years back to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 213

#years_aheadCalendar::Year?

Get the index-relative year some number of years ahead. Returns nil if no single year can be identified.

Parameters:

  • offset (Integer)

    the number of years forward to shift this period

Returns:



# File 'lib/timeboss/calendar/support/shiftable.rb', line 219