Sha256: 7a52d969293385158642b12fc455e32b76c053b1a62ed72d442d342d05dde0a9

Contents?: true

Size: 631 Bytes

Versions: 170

Compression:

Stored size: 631 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc
  module Errors #:nodoc

    # This exception is raised when a bad value is attempted to be converted to
    # a date or time.
    class InvalidTime < MongoidError

      attr_reader :klass, :value

      # Create the new invalid date error.
      #
      # @example Create the new invalid date error.
      #   InvalidTime.new("this is not a time")
      #
      # @param [ Object ] value The value that was attempted.
      #
      # @since 2.3.1
      def initialize(value)
        @value = value
        super(translate("invalid_time", { :value => value }))
      end
    end
  end
end

Version data entries

170 entries across 78 versions & 4 rubygems

Version Path
mongoid-2.7.1 lib/mongoid/errors/invalid_time.rb
mongoid-2.7.0 lib/mongoid/errors/invalid_time.rb
mongoid-2.6.0 lib/mongoid/errors/invalid_time.rb
mongoid-2.5.2 lib/mongoid/errors/invalid_time.rb
classiccms-0.6.9 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.9 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.9 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.8 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.8 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.8 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.7 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.7 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.7 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_time.rb
mongoid-2.5.1 lib/mongoid/errors/invalid_time.rb
classiccms-0.6.6 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.6 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.6 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.5 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.5 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/errors/invalid_time.rb
classiccms-0.6.5 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/errors/invalid_time.rb