module Periods::Modules::HalfyearlyPeriod::InstanceMethods

Public Instance Methods

days() click to toggle source
# File lib/periods/modules/halfyearly_period.rb, line 26
def days
  (self.next.start_date - start_date).to_i
end
next() click to toggle source
# File lib/periods/modules/halfyearly_period.rb, line 18
def next
  self.class.for(start_date.next_month(6))
end
previous() click to toggle source
# File lib/periods/modules/halfyearly_period.rb, line 22
def previous
  self.class.for(start_date.prev_month(6))
end

Private Instance Methods

init_with_date(date) click to toggle source
# File lib/periods/modules/halfyearly_period.rb, line 31
def init_with_date(date)
  init_with_dates(date, date.next_month(6).prev_day)
end