Module: Mongoid::Matcher::BitsAllClear Private

Extended by:
BitsAllClear
Includes:
Bits
Included in:
BitsAllClear
Defined in:
build/mongoid-7.3/lib/mongoid/matcher/bits_all_clear.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods included from Bits

#matches?, operator_name

Instance Method Details

#array_matches?(value, condition) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



9
10
11
12
13
# File 'build/mongoid-7.3/lib/mongoid/matcher/bits_all_clear.rb', line 9

def array_matches?(value, condition)
  condition.all? do |c|
    value & (1<<c) == 0
  end
end

#int_matches?(value, condition) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



15
16
17
# File 'build/mongoid-7.3/lib/mongoid/matcher/bits_all_clear.rb', line 15

def int_matches?(value, condition)
  value & condition == 0
end