Class: MockRedis::ExpireWrapper

Inherits:
Object
  • Object
show all
Includes:
UndefRedisMethods
Defined in:
lib/mock_redis/expire_wrapper.rb

Instance Method Summary collapse

Methods included from UndefRedisMethods

included

Constructor Details

#initialize(db) ⇒ ExpireWrapper

Returns a new instance of ExpireWrapper.



11
12
13
# File 'lib/mock_redis/expire_wrapper.rb', line 11

def initialize(db)
  @db = db
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



15
16
17
18
# File 'lib/mock_redis/expire_wrapper.rb', line 15

def method_missing(method, *args)
  @db.expire_keys
  @db.send(method, *args)
end

Instance Method Details

#initialize_copy(source) ⇒ Object



20
21
22
23
# File 'lib/mock_redis/expire_wrapper.rb', line 20

def initialize_copy(source)
  super
  @db = @db.clone
end

#respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/mock_redis/expire_wrapper.rb', line 7

def respond_to?(method, include_private=false)
  super || @db.respond_to?(method)
end