Sha256: ec0566dd593b6833b1e70bc65ccd3c920c21f51c704ef3d1345a35e898209994

Contents?: true

Size: 386 Bytes

Versions: 4

Compression:

Stored size: 386 Bytes

Contents

module Monthify
  module CoreExt
    module Object
      # Converts the object to a month. Uses the same logic as Kernel::Month().
      # Raises an ArgumentError if the object cannot be converted.
      #@return [Month] the object converted to a Month
      def to_month
        ::Kernel::Month(self)
      end
    end
  end
end

class ::Object
  include Monthify::CoreExt::Object
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
monthify-1.0.1 lib/monthify/core_ext/object.rb
monthify-1.0.0 lib/monthify/core_ext/object.rb
monthify-0.0.3 lib/monthify/core_ext/object.rb
monthify-0.0.2 lib/monthify/core_ext/object.rb