Module: Periods::Modules::Quarter::InstanceMethods

Defined in:
lib/periods/modules/quarter.rb

Instance Method Summary collapse

Instance Method Details

#initialize(date) ⇒ Object



26
27
28
29
30
# File 'lib/periods/modules/quarter.rb', line 26

def initialize(date)
  date = Date.parse(date.to_s)
  @start_date = beginning_of_month(date)
  @end_date   = end_of_month(@start_date.next_month(2))
end

#monthsObject



32
33
34
35
36
# File 'lib/periods/modules/quarter.rb', line 32

def months
  [ Periods::Month.for(start_date),
    Periods::Month.for(start_date.next_month),
    Periods::Month.for(start_date.next_month(2)) ]
end