123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Criteria::Queryable::Extensions::Time::ClassMethods

Relationships & Source Files
Defined in: lib/mongoid/criteria/queryable/extensions/time.rb

Instance Method Summary

Instance Method Details

#evolve(object) ⇒ Time

Evolve the object to an date.

Examples:

Evolve dates.

Evolve string dates.

Evolve date ranges.

Parameters:

  • object (Object)

    The object to evolve.

Returns:

  • (Time)

    The evolved date time.

[ GitHub ]

  
# File 'lib/mongoid/criteria/queryable/extensions/time.rb', line 45

def evolve(object)
  res = begin
    object.try(:__evolve_time__)
  rescue ArgumentError
    nil
  end
  res.nil? ? object : res
end