Sha256: e6b2dcc7c1d882fcf1bd8364116fb4424858b4cfdfe9498829721f3caf9431ec

Contents?: true

Size: 433 Bytes

Versions: 4

Compression:

Stored size: 433 Bytes

Contents

begin
  require 'fakeredis'
rescue LoadError
  require 'redis'
end

require 'active_orm/redis/base'
require 'active_orm/redis/configuration'

class ActiveOrm::Redis < ActiveOrm::Base
  extend Base

  attr_accessor :client

  def initialize(client = nil)
    @client ||= (client.nil? ? ActiveOrm::Redis.configuration.client : client)
  end

  def self.client(client = nil)
    client.nil? ? new.client : new(client).client
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_orm-4.0.3 lib/active_orm/redis.rb
active_orm-4.0.2 lib/active_orm/redis.rb
active_orm-4.0.1 lib/active_orm/redis.rb
active_orm-4.0.0 lib/active_orm/redis.rb