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.



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

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

Instance Attribute Details

#clientObject

Returns the value of attribute client.



13
14
15
# File 'lib/active_orm/redis.rb', line 13

def client
  @client
end

Class Method Details

.client(client = nil) ⇒ Object



19
20
21
# File 'lib/active_orm/redis.rb', line 19

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