Module: Mongoid::Matcher::BitsAnyClear Private
- Extended by:
- BitsAnyClear
- Includes:
- Bits
- Included in:
- BitsAnyClear
- Defined in:
- lib/mongoid/matcher/bits_any_clear.rb
Overview
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.
In-memory matcher for $bitsAnyClear expression.
Instance Method Summary collapse
-
#array_matches?(value, condition) ⇒ true | false
private
Returns whether a position list condition matches a value.
-
#int_matches?(value, condition) ⇒ true | false
private
Returns whether a bitmask condition matches a value.
Methods included from Bits
Instance Method Details
#array_matches?(value, condition) ⇒ true | false
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 whether a position list condition matches a value.
22 23 24 25 26 |
# File 'lib/mongoid/matcher/bits_any_clear.rb', line 22 def array_matches?(value, condition) condition.any? do |c| value & (1<<c) == 0 end end |
#int_matches?(value, condition) ⇒ true | false
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 whether a bitmask condition matches a value.
36 37 38 |
# File 'lib/mongoid/matcher/bits_any_clear.rb', line 36 def int_matches?(value, condition) value & condition < condition end |