Module: Entangled::Helpers

Included in:
Controller::InstanceMethods, Model::InstanceMethods
Defined in:
lib/entangled/helpers.rb

Instance Method Summary collapse

Instance Method Details

#redisObject

Get Redis that user might be using or instantiate a new one



5
6
7
8
9
10
11
12
13
# File 'lib/entangled/helpers.rb', line 5

def redis
  if defined?($redis) && $redis
    Redis.new($redis.client.options)
  elsif defined?(REDIS) && REDIS
    Redis.new(REDIS.client.options)
  else
    Redis.new
  end
end