Module: Mongoid::Criteria::Queryable::Extensions::Set::ClassMethods

Defined in:
build/mongoid-master/lib/mongoid/criteria/queryable/extensions/set.rb

Instance Method Summary collapse

Instance Method Details

#evolve(object) ⇒ Array

Evolve the set, casting all its elements.

Examples:

Evolve the set.

Set.evolve(set)

Parameters:

  • object (Set, Object)

    The object to evolve.

Returns:

  • (Array)

    The evolved set.

Since:

  • 1.0.0



25
26
27
28
# File 'build/mongoid-master/lib/mongoid/criteria/queryable/extensions/set.rb', line 25

def evolve(object)
  return object if !object || !object.respond_to?(:map)
  object.map{ |obj| obj.class.evolve(obj) }
end