Class: Rudis::Base

Inherits:
Rudis
  • Object
show all
Defined in:
lib/rudis/base.rb

Direct Known Subclasses

Structure

Class Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Rudis

key

Constructor Details

#initialize(key, options = {}) ⇒ Base

Returns a new instance of Base.



40
41
42
43
44
# File 'lib/rudis/base.rb', line 40

def initialize(key, options={})
  @key = key
  @options = options
  @options.rmerge!(default_options)
end

Class Attribute Details

.redisObject



31
32
33
# File 'lib/rudis/base.rb', line 31

def self.redis
  @redis ||= super
end

Instance Method Details

#default_optionsObject



46
47
48
# File 'lib/rudis/base.rb', line 46

def default_options
  {}
end

#key(*args) ⇒ Object



50
51
52
# File 'lib/rudis/base.rb', line 50

def key(*args)
  self.class.key(@key, *args)
end

#redisObject



36
37
38
# File 'lib/rudis/base.rb', line 36

def redis
  @redis ||= self.class.redis
end