Class: SnippetStoreService

Inherits:
Object
  • Object
show all
Defined in:
app/services/snippet_store_service.rb

Class Method Summary collapse

Class Method Details

.del(key) ⇒ Object



8
9
10
11
# File 'app/services/snippet_store_service.rb', line 8

def del(key)
  ensure_key_is_defined!(key)
  RedisSnippets::Redis.del("snippets:#{key}")
end

.method_missing(method, *args) ⇒ Object

Retrieve snippet.



14
15
16
# File 'app/services/snippet_store_service.rb', line 14

def method_missing(method, *args)
  RedisSnippets::Redis.get("snippets:#{method}")
end

.update(key, content) ⇒ Object



3
4
5
6
# File 'app/services/snippet_store_service.rb', line 3

def update(key, content)
  ensure_key_is_defined!(key)
  RedisSnippets::Redis.set("snippets:#{key}", content)
end