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

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

Instance Method Summary collapse

Instance Method Details

#monthObject Also known as: number



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

def month
  start_date.month
end

#to_s(*args) ⇒ Object



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

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

#yearObject



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

def year
  start_date.year
end