Class: Month
- Inherits:
-
Object
- Object
- Month
- Defined in:
- lib/month/serializer.rb,
lib/month/serializer/version.rb
Defined Under Namespace
Modules: Serializer
Instance Method Summary collapse
-
#to_date ⇒ Object
Does the same thing as Month#start_date, but to_<class> is a common idiom for built-in class conversion methods.
- #to_i ⇒ Object
Instance Method Details
#to_date ⇒ Object
Does the same thing as Month#start_date, but to_<class> is a common idiom
for built-in class conversion methods.
102 103 104 |
# File 'lib/month/serializer.rb', line 102 def to_date Date.new(year, number, 1) end |
#to_i ⇒ Object
90 91 92 93 94 95 96 97 98 |
# File 'lib/month/serializer.rb', line 90 def to_i yr = year mon = number if number == 12 mon = 0 yr += 1 end yr * 12 + mon end |