Sha256: 9a5beb0ae25fc286291f2d96157021dd68950b6c208abe288f99d96f8d47198e

Contents?: true

Size: 924 Bytes

Versions: 16

Compression:

Stored size: 924 Bytes

Contents

# frozen_string_literal: true

module Mongoid
  class Criteria
    module Queryable
      module Extensions

        # This module contains extensions for boolean selection.
        module Boolean
          module ClassMethods

            # Evolve the value into a boolean value stored in MongoDB. Will return
            # true for any of these values: true, t, yes, y, 1, 1.0.
            #
            # @example Evolve the value to a boolean.
            #   Boolean.evolve(true)
            #
            # @param [ Object ] object The object to evolve.
            #
            # @return [ true | false ] The boolean value.
            def evolve(object)
              __evolve__(object) do |obj|
                mongoize(obj)
              end
            end
          end
        end
      end
    end
  end
end

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mongoid-8.1.8 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.7 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.6 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.0.8 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.5 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.4 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.0.7 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.3 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.2 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.0.6 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.1 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.0.5 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.1.0 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.0.4 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.0.3 lib/mongoid/criteria/queryable/extensions/boolean.rb
mongoid-8.0.2 lib/mongoid/criteria/queryable/extensions/boolean.rb