Sha256: 39d2f652692aa1fd7ec298a65f200e368ae6e6f7e82764b1caeefedcc240f22c

Contents?: true

Size: 857 Bytes

Versions: 38

Compression:

Stored size: 857 Bytes

Contents

# encoding: utf-8
require "set"

module Mongoid
  class Criteria
    module Queryable
      module Extensions

        # This module contains additional object behaviour.
        module Set
          module ClassMethods

            # Evolve the set, casting all its elements.
            #
            # @example Evolve the set.
            #   Set.evolve(set)
            #
            # @param [ Set, Object ] object The object to evolve.
            #
            # @return [ Array ] The evolved set.
            #
            # @since 1.0.0
            def evolve(object)
              return object if !object || !object.respond_to?(:map)
              object.map{ |obj| obj.class.evolve(obj) }
            end
          end
        end
      end
    end
  end
end

::Set.__send__(:extend, Mongoid::Criteria::Queryable::Extensions::Set::ClassMethods)

Version data entries

38 entries across 36 versions & 2 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.12 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-6.4.8 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.11 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.10 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-6.4.7 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-6.4.5 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.8 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.7 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.6 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.5 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.4 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-6.4.4 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.3 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-6.4.2 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.2 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.1 lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-6.4.1 lib/mongoid/criteria/queryable/extensions/set.rb
tdiary-5.0.8 vendor/bundle/gems/mongoid-6.4.0/lib/mongoid/criteria/queryable/extensions/set.rb
mongoid-7.0.0 lib/mongoid/criteria/queryable/extensions/set.rb