Class: ActiveOrm::Redis

Inherits:
Base
  • Object
show all
Extended by:
Base
Defined in:
lib/active_orm/redis.rb

Defined Under Namespace

Classes: Connection, Geo, Hash, HyperLogLog, Key, List, PubSub, Script, Set, SortedSet, String, Transaction

Instance Attribute Summary collapse

Attributes inherited from Base

#configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

evaluate, evaluate?

Methods inherited from Base

configuration, configuration=, configure

Constructor Details

#initialize(client = nil) ⇒ Redis

Returns a new instance of Redis.



11
12
13
# File 'lib/active_orm/redis.rb', line 11

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

Instance Attribute Details

#clientObject

Returns the value of attribute client.



9
10
11
# File 'lib/active_orm/redis.rb', line 9

def client
  @client
end

Class Method Details

.client(client = nil) ⇒ Object



15
16
17
# File 'lib/active_orm/redis.rb', line 15

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