Class: ActiveOrm::Redis
- Extended by:
- Base
- Defined in:
- lib/active_orm/redis.rb
Direct Known Subclasses
Connection, Geo, Hash, HyperLogLog, Key, List, PubSub, Script, Set, SortedSet, String, Transaction
Defined Under Namespace
Classes: Connection, Geo, Hash, HyperLogLog, Key, List, PubSub, Script, Set, SortedSet, String, Transaction
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client = nil) ⇒ Redis
constructor
A new instance of Redis.
Methods included from Base
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
#client ⇒ Object
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 |