Module: Periods::Modules::Month::InstanceMethods
- Defined in:
- lib/periods/modules/month.rb
Instance Method Summary collapse
- #month ⇒ Object (also: #number)
- #to_s(*args) ⇒ Object
- #year ⇒ Object
Instance Method Details
#month ⇒ Object 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 |
#year ⇒ Object
24 25 26 |
# File 'lib/periods/modules/month.rb', line 24 def year start_date.year end |