Module: Mongoid::Matcher::BitsAnyClear Private

Extended by:
BitsAnyClear
Includes:
Bits
Included in:
BitsAnyClear
Defined in:
build/mongoid-master/lib/mongoid/matcher/bits_any_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?

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-master/lib/mongoid/matcher/bits_any_clear.rb', line 9

def array_matches?(value, condition)
  condition.any? 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-master/lib/mongoid/matcher/bits_any_clear.rb', line 15

def int_matches?(value, condition)
  value & condition < condition
end