Class: RedisWrapper

Inherits:
Redis
  • Object
show all
Defined in:
lib/sysarcana/data/redis_wrapper.rb

Instance Method Summary collapse

Instance Method Details

#hgetall(key) ⇒ Object



13
14
15
# File 'lib/sysarcana/data/redis_wrapper.rb', line 13

def hgetall(key)
  normalize_hash(super)
end

#nillify_string(s) ⇒ Object



5
6
7
# File 'lib/sysarcana/data/redis_wrapper.rb', line 5

def nillify_string(s)
  s.empty? ? nil : s
end

#normalize_hash(h) ⇒ Object



9
10
11
# File 'lib/sysarcana/data/redis_wrapper.rb', line 9

def normalize_hash(h)
  h.inject({}) { |h, (k,v)| h[k] = nillify_string(v); h }  
end