Module: Redis::Server
- Defined in:
- lib/redis/server.rb
Instance Method Summary collapse
- #redis_DBSIZE ⇒ Object
- #redis_DEBUG(type, key = nil) ⇒ Object
- #redis_FLUSHALL ⇒ Object
- #redis_FLUSHDB ⇒ Object
- #redis_INFO ⇒ Object
Instance Method Details
#redis_DBSIZE ⇒ Object
17 18 19 |
# File 'lib/redis/server.rb', line 17 def redis_DBSIZE @database.size end |
#redis_DEBUG(type, key = nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/redis/server.rb', line 21 def redis_DEBUG type, key=nil if type.upcase == 'OBJECT' "#{@database[key].class}" value = @database[key] # encoding values are meaningless, they make tcl tests pass # and don't forget they need a trailing space if String === value "Value #{value.class}:#{value.object_id} encoding:raw encoding:int " elsif Numeric === value "Value #{value.class}:#{value.object_id} encoding:int " elsif Array === value "Value #{value.class}:#{value.object_id} encoding:ziplist encoding:linkedlist " elsif Hash === value "Value #{value.class}:#{value.object_id} encoding:zipmap encoding:hashtable " elsif Set === value "Value #{value.class}:#{value.object_id} encoding:intset encoding:hashtable " else "Value #{value.class}:#{value.object_id}" end elsif type.upcase == 'RELOAD' "TODO: what is reload" else raise 'not supported' end end |
#redis_FLUSHALL ⇒ Object
10 11 12 13 14 15 |
# File 'lib/redis/server.rb', line 10 def redis_FLUSHALL @databases.each do |database| database.clear end :'+OK' end |
#redis_FLUSHDB ⇒ Object
5 6 7 8 |
# File 'lib/redis/server.rb', line 5 def redis_FLUSHDB @database.clear :'+OK' end |