Module: Periods::Modules::YearlyPeriod::InstanceMethods

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

Instance Method Summary collapse

Instance Method Details

#daysObject



40
41
42
# File 'lib/periods/modules/yearly_period.rb', line 40

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

#nextObject

25.06.2015 => 25.06.2016



29
30
31
# File 'lib/periods/modules/yearly_period.rb', line 29

def next
  self.class.for(start_date.next_year)
end

#previousObject

25.06.2015 => 25.06.2014



36
37
38
# File 'lib/periods/modules/yearly_period.rb', line 36

def previous
  self.class.for(start_date.prev_year)
end