class Redis

def bitpos(key, bit, start = nil, stop = nil)

Returns:
  • (Integer) - the position of the first 1/0 bit.

Parameters:
  • stop (Integer) -- stop index
  • start (Integer) -- start index
  • bit (Integer) -- whether to look for the first 1 or 0 bit
  • key (String) --
def bitpos(key, bit, start = nil, stop = nil)
  raise(ArgumentError, 'stop parameter specified without start parameter') if stop && !start
  synchronize do |client|
    command = [:bitpos, key, bit]
    command << start if start
    command << stop if stop
    client.call(command)
  end
end