Class: TimeBoss::Calendar::Support::MonthBasis Abstract
- Inherits:
-
Object
- Object
- TimeBoss::Calendar::Support::MonthBasis
- Defined in:
- lib/timeboss/calendar/support/month_basis.rb
Overview
This class is abstract.
A MonthBasis must define a ‘#start_date` and `#end_date` method. These methods should be calculated based on the incoming `#year` and `#month` values.
Direct Known Subclasses
TimeBoss::Calendars::Broadcast::Basis, TimeBoss::Calendars::Gregorian::Basis
Instance Attribute Summary collapse
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(year, month) ⇒ MonthBasis
constructor
A new instance of MonthBasis.
- #to_range ⇒ Object
Constructor Details
#initialize(year, month) ⇒ MonthBasis
Returns a new instance of MonthBasis.
10 11 12 13 |
# File 'lib/timeboss/calendar/support/month_basis.rb', line 10 def initialize(year, month) @year = year @month = month end |
Instance Attribute Details
#month ⇒ Object (readonly)
Returns the value of attribute month.
8 9 10 |
# File 'lib/timeboss/calendar/support/month_basis.rb', line 8 def month @month end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
8 9 10 |
# File 'lib/timeboss/calendar/support/month_basis.rb', line 8 def year @year end |
Instance Method Details
#to_range ⇒ Object
15 16 17 |
# File 'lib/timeboss/calendar/support/month_basis.rb', line 15 def to_range @_to_range ||= start_date..end_date end |