module Periods::Modules::YearlyPeriod::InstanceMethods

Public Instance Methods

days() click to toggle source
# File lib/periods/modules/yearly_period.rb, line 32
def days
  (self.next.start_date - start_date).to_i
end
next() click to toggle source

25.06.2015 => 25.06.2016

# File lib/periods/modules/yearly_period.rb, line 21
def next
  self.class.for(start_date.next_year)
end
previous() click to toggle source

25.06.2015 => 25.06.2014

# File lib/periods/modules/yearly_period.rb, line 28
def previous
  self.class.for(start_date.prev_year)
end

Private Instance Methods

init_with_date(date) click to toggle source
# File lib/periods/modules/yearly_period.rb, line 37
def init_with_date(date)
  init_with_dates(date, date.next_year.prev_day)
end