Class: Lite::Redis::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/lite/redis/base.rb
Direct Known Subclasses
Connection, Geo, Hash, HyperLogLog, Key, List, PubSub, Script, Set, SortedSet, String, Transaction
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(redis = nil) ⇒ Base
Returns a new instance of Base.
9
10
11
|
# File 'lib/lite/redis/base.rb', line 9
def initialize(redis = nil)
@client = redis
end
|
Instance Attribute Details
Class Method Details
.method_missing(method_name, *args, **kwargs, &block) ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/lite/redis/base.rb', line 15
def method_missing(method_name, *args, **kwargs, &block)
instance = new
if instance.respond_to_method?(method_name)
instance.send(method_name, *args, **kwargs, &block)
else
super
end
end
|
Instance Method Details
#respond_to_method?(method_name) ⇒ Boolean
31
32
33
|
# File 'lib/lite/redis/base.rb', line 31
def respond_to_method?(method_name)
public_methods.include?(method_name)
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
35
36
37
|
# File 'lib/lite/redis/base.rb', line 35
def respond_to_missing?(method_name, include_private = false)
respond_to_method?(method_name) || super
end
|