Class: Lotus::Model::Mapping::Coercers::Time Private

Inherits:
Coercer
  • Object
show all
Defined in:
lib/lotus/model/mapping/coercers.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Time coercer

See Also:

Since:

  • 0.5.0

Class Method Summary collapse

Methods inherited from Coercer

dump

Class Method Details

.load(value) ⇒ Time

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Transform a value from the database into a Time, unless nil

Parameters:

  • value (Object)

    the object to coerce

Returns:

  • (Time)

    the result of the coercion

Raises:

  • (TypeError)

    if the value can’t be coerced

See Also:

Since:

  • 0.5.0



307
308
309
# File 'lib/lotus/model/mapping/coercers.rb', line 307

def self.load(value)
  Utils::Kernel.Time(value) unless value.nil?
end