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 Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

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.



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

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