There are some instance methods on Redis class. They are defined in the source code and they work. BUT they don’t show up in Redis#methods output!
require 'redis'
redis = Redis.new # => #<Redis client v3.0.2 for redis://127.0.0.1:6379/0>
redis.info['redis_version'] # => "2.6.4"
k = 'foo'
redis.setbit k, 1, 1
redis.setbit k, 3, 1
redis.setbit k, 11, 1
redis.bitcount k # => 3
redis.methods.grep(/bit/) # => [:setbit, :getbit]
# no bitcount in the methods!
Method definitions: getbit, setbit, bitcount, bitop.
From what I can tell, bitcount/bitop should appear in methods. But they don’t. Any thoughts?
I need them to be listed in methods so that another gem works (it defines proxy methods for redis commands which it gets from Redis#methods).
The released version of the gem does not define those methods explicitly, you can confirm this by checking your installed source or
redis.method :bitcounthttps://github.com/redis/redis-rb/blob/v3.0.2/lib/redis.rb
They work because the method missing simply passing them on to the redis server blindly.