Method: Redis#bitpos
- Defined in:
- lib/redis.rb
#bitpos(key, bit, start = nil, stop = nil) ⇒ Fixnum
Return the position of the first bit set to 1 or 0 in a string.
917 918 919 920 921 922 923 924 925 926 927 928 |
# File 'lib/redis.rb', line 917 def bitpos(key, bit, start=nil, stop=nil) if stop and not start raise(ArgumentError, 'stop parameter specified without start parameter') end synchronize do |client| command = [:bitpos, key, bit] command << start if start command << stop if stop client.call(command) end end |