Class: RedisVars::Store
- Inherits:
-
Object
- Object
- RedisVars::Store
- Defined in:
- lib/redis_vars/store.rb
Instance Method Summary collapse
Instance Method Details
#add(key, value) ⇒ Object
7 8 9 |
# File 'lib/redis_vars/store.rb', line 7 def add(key, value) redis.hset app_key, key.upcase, value end |
#export ⇒ Object
23 24 25 |
# File 'lib/redis_vars/store.rb', line 23 def export map {|key, val| "export #{key.upcase}=#{val}"}.join("\n") end |
#hash ⇒ Object
15 16 17 |
# File 'lib/redis_vars/store.rb', line 15 def hash redis.hgetall(app_key) end |
#list ⇒ Object
19 20 21 |
# File 'lib/redis_vars/store.rb', line 19 def list map {|key, val| "#{key.upcase}=#{val}"}.join("\n") end |
#remove(key) ⇒ Object
11 12 13 |
# File 'lib/redis_vars/store.rb', line 11 def remove(key) redis.hdel app_key, key.upcase end |