Module: Monthify::CoreExt::Object

Included in:
Object
Defined in:
lib/monthify/core_ext/object.rb

Instance Method Summary collapse

Instance Method Details

#to_monthMonth

Converts the object to a month. Uses the same logic as Kernel::Month(). Raises an ArgumentError if the object cannot be converted.

Returns:

  • (Month)

    the object converted to a Month



7
8
9
# File 'lib/monthify/core_ext/object.rb', line 7

def to_month
  ::Kernel::Month(self)
end