Class: TimeBoss::Calendar::Year

Inherits:
Support::MonthlyUnit show all
Defined in:
lib/timeboss/calendar/year.rb

Constant Summary collapse

NUM_MONTHS =
12

Constants inherited from Support::Unit

Support::Unit::UnsupportedUnitError

Constants included from Support::Translatable

Support::Translatable::PERIODS

Instance Attribute Summary

Attributes inherited from Support::MonthlyUnit

#index, #year_index

Attributes inherited from Support::Unit

#calendar, #end_date, #start_date

Instance Method Summary collapse

Methods inherited from Support::MonthlyUnit

#initialize, #to_s, #weeks

Methods inherited from Support::Unit

#+, #-, #==, #current?, #dates, #format, #initialize, #inspect, #offset, #thru, #to_range, type

Methods included from Support::Clampable

#clamp

Methods included from Support::Shiftable

#days_ago, #days_ahead, #halves_ago, #halves_ahead, #in_day, #in_half, #in_month, #in_quarter, #in_week, #in_year, #last_day, #last_half, #last_month, #last_quarter, #last_week, #last_year, #months_ago, #months_ahead, #next_day, #next_half, #next_month, #next_quarter, #next_week, #next_year, #quarters_ago, #quarters_ahead, #this_day, #this_half, #this_month, #this_quarter, #this_week, #this_year, #weeks_ago, #weeks_ahead, #years_ago, #years_ahead

Methods included from Support::Translatable

#day, #days, #half, #halves, #month, #months, #quarter, #quarters, #week, #weeks, #year, #years

Methods included from Support::Navigable

#ago, #ahead, #next, #previous, #until

Constructor Details

This class inherits a constructor from TimeBoss::Calendar::Support::MonthlyUnit

Instance Method Details

#nameString Also known as: title

Get a simple representation of this year.

Returns:

  • (String)

    (e.g. “2020”)



12
13
14
# File 'lib/timeboss/calendar/year.rb', line 12

def name
  year_index.to_s
end