Module: Periods::Modules::HalfyearlyPeriod::InstanceMethods

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

Instance Method Summary collapse

Instance Method Details

#daysObject



34
35
36
# File 'lib/periods/modules/halfyearly_period.rb', line 34

def days
  (self.next.start_date - start_date).to_i
end

#nextObject



26
27
28
# File 'lib/periods/modules/halfyearly_period.rb', line 26

def next
  self.class.for(start_date.next_month(6))
end

#previousObject



30
31
32
# File 'lib/periods/modules/halfyearly_period.rb', line 30

def previous
  self.class.for(start_date.prev_month(6))
end