Module: Periods::Modules::Month::InstanceMethods

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

Instance Method Summary collapse

Instance Method Details

#monthObject Also known as: number



17
18
19
# File 'lib/periods/modules/month.rb', line 17

def month
  start_date.month
end

#to_s(*args) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/periods/modules/month.rb', line 27

def to_s(*args)
  if args.first.to_s == 'month'
    "#{start_date.strftime("%m.%Y")}"
  else
    super
  end
end

#yearObject



23
24
25
# File 'lib/periods/modules/month.rb', line 23

def year
  start_date.year
end