Module: Periods::Modules::Year::InstanceMethods
- Defined in:
- lib/periods/modules/year.rb
Instance Method Summary collapse
- #days ⇒ Object
- #halfyears ⇒ Object
- #months ⇒ Object
-
#next ⇒ Object
01.06.2015 => 01.06.2016.
-
#previous ⇒ Object
01.06.2015 => 01.06.2014.
- #quarters ⇒ Object
Instance Method Details
#days ⇒ Object
30 31 32 |
# File 'lib/periods/modules/year.rb', line 30 def days (self.next.start_date - start_date).to_i end |
#halfyears ⇒ Object
50 51 52 |
# File 'lib/periods/modules/year.rb', line 50 def halfyears [Periods::Halfyear.for(start_date), Periods::Halfyear.for(start_date.next_month(6))] end |
#months ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/periods/modules/year.rb', line 34 def months months = [Periods::Month.for(start_date)] 1.upto(11) do |idx| months << Periods::Month.for(start_date.next_month(idx)) end months end |
#next ⇒ Object
01.06.2015 => 01.06.2016
19 20 21 |
# File 'lib/periods/modules/year.rb', line 19 def next self.class.for(start_date.next_year) end |
#previous ⇒ Object
01.06.2015 => 01.06.2014
26 27 28 |
# File 'lib/periods/modules/year.rb', line 26 def previous self.class.for(start_date.prev_year) end |