Sha256: ab290ae18661a8cec06eb36f1c2c1a2199f703f7f32ff2139e7ba9524f203e30
Contents?: true
Size: 629 Bytes
Versions: 6
Compression:
Stored size: 629 Bytes
Contents
class SnippetStoreService class << self def update(key, content) ensure_key_is_defined!(key) RedisSnippets::Redis.set("snippets:#{key}", content) end def del(key) ensure_key_is_defined!(key) RedisSnippets::Redis.del("snippets:#{key}") end # Retrieve snippet. def method_missing(method, *args) RedisSnippets::Redis.get("snippets:#{method}") end protected def ensure_key_is_defined!(key) raise UndefinedSnippetsKey.new("#{key} not in the specified keys.") unless RedisSnippets::Engine.config.redis_snippets[:keys].include?(key.to_sym) end end end
Version data entries
6 entries across 6 versions & 1 rubygems