Module: Mongoid::Extensions::FalseClass

Defined in:
build/mongoid-8.1/lib/mongoid/extensions/false_class.rb

Instance Method Summary collapse

Instance Method Details

#__sortable__Integer

Get the value of the object as a mongo friendly sort value.

Examples:

Get the object as sort criteria.

object.__sortable__

Returns:



13
14
15
# File 'build/mongoid-8.1/lib/mongoid/extensions/false_class.rb', line 13

def __sortable__
  0
end

#is_a?(other) ⇒ true | false

Is the passed value a boolean?

Examples:

Is the value a boolean type?

false.is_a?(Boolean)

Parameters:

  • other (Class)

    The class to check.

Returns:

  • (true | false)

    If the other is a boolean.



25
26
27
28
29
30
# File 'build/mongoid-8.1/lib/mongoid/extensions/false_class.rb', line 25

def is_a?(other)
  if other == Mongoid::Boolean || other.class == Mongoid::Boolean
    return true
  end
  super(other)
end