Class: Harmony::Service::Utils::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/harmony/service/utils/storage.rb

Instance Method Summary collapse

Instance Method Details

#clear(key) ⇒ Object



14
15
16
# File 'lib/harmony/service/utils/storage.rb', line 14

def clear(key)
  redis.del(key)
end

#get(key) ⇒ Object



5
6
7
8
# File 'lib/harmony/service/utils/storage.rb', line 5

def get(key)
  json = redis.get(key)
  JSON.parse(json) if json
end

#set(key, value) ⇒ Object



10
11
12
# File 'lib/harmony/service/utils/storage.rb', line 10

def set(key, value)
  redis.set(key, value.to_json)
end