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

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

Instance Method Summary collapse

Instance Method Details

#daysObject



32
33
34
# File 'lib/periods/modules/yearly_period.rb', line 32

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

#nextObject

25.06.2015 => 25.06.2016



21
22
23
# File 'lib/periods/modules/yearly_period.rb', line 21

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

#previousObject

25.06.2015 => 25.06.2014



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

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