Class: TimeBoss::Calendar::Support::MonthBasis Abstract

Inherits:
Object
  • Object
show all
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.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#monthObject (readonly)

Returns the value of attribute month.



8
9
10
# File 'lib/timeboss/calendar/support/month_basis.rb', line 8

def month
  @month
end

#yearObject (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_rangeObject



15
16
17
# File 'lib/timeboss/calendar/support/month_basis.rb', line 15

def to_range
  @_to_range ||= start_date..end_date
end