Module: Mongoid::Extensions::TrueClass::Equality

Included in:
TrueClass
Defined in:
lib/mongoid/extensions/true_class/equality.rb

Overview

Adds equality hooks for true values.

Instance Method Summary collapse

Instance Method Details

#is_a?(other) ⇒ true, false

Is the passed value a boolean?

Examples:

Is the value a boolean type?

true.is_a?(Boolean)

Parameters:

  • other (Class)

    The class to check.

Returns:

  • (true, false)

    If the other is a boolean.

Since:

  • 1.0.0



19
20
21
22
# File 'lib/mongoid/extensions/true_class/equality.rb', line 19

def is_a?(other)
  return true if other.name == "Boolean"
  super(other)
end