Module: EasyRedis::Methods

Included in:
ActiveRecord::Base
Defined in:
lib/easy_redis/methods/methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/easy_redis/methods/methods.rb', line 9

def self.included(klass)
  klass.class_eval do
    include EasyRedis::Getters
    include EasyRedis::Setters
    include EasyRedis::Deleters
  end
end

Instance Method Details

#redis_cliObject



22
23
24
# File 'lib/easy_redis/methods/methods.rb', line 22

def redis_cli
  EasyRedis::Redis.redis
end

#redis_keyObject



17
18
19
20
# File 'lib/easy_redis/methods/methods.rb', line 17

def redis_key
  raise NonExistentObjectError if self.new_record? && EasyRedis::Redis.raise_non_existent_object_error?
  @redis_key ||= "#{EasyRedis::Redis.namespace}:attributes:#{self.class.name}:#{self.id}"
end