Exception: Mongoid::Errors::InvalidTime

Inherits:
MongoidError
  • Object
show all
Defined in:
lib/mongoid/errors/invalid_time.rb

Overview

This exception is raised when a bad value is attempted to be converted to a date or time.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(value) ⇒ InvalidTime

Create the new invalid date error.

Examples:

Create the new invalid date error.

InvalidTime.new("this is not a time")

Parameters:

  • value (Object)

    The value that was attempted.

Since:

  • 2.3.1



17
18
19
# File 'lib/mongoid/errors/invalid_time.rb', line 17

def initialize(value)
  super(compose_message("invalid_time", { value: value }))
end