Sha256: 9051a694ad9dbd02b74a09f167f9c934a0e2172a59c911813952e811ed0403f9

Contents?: true

Size: 312 Bytes

Versions: 5

Compression:

Stored size: 312 Bytes

Contents

module Entangled
  module Helpers
    # Get Redis that user might be using or instantiate
    # a new one
    def redis
      if defined?($redis)
        Redis.new($redis.client.options)
      elsif defined?(REDIS)
        Redis.new(REDIS.client.options)
      else
        Redis.new
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
entangled-0.0.16 lib/entangled/helpers.rb
entangled-0.0.15 lib/entangled/helpers.rb
entangled-0.0.14 lib/entangled/helpers.rb
entangled-0.0.13 lib/entangled/helpers.rb
entangled-0.0.12 lib/entangled/helpers.rb