Class: IRC::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/irc/store.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Store

Returns a new instance of Store.



8
9
10
11
# File 'lib/irc/store.rb', line 8

def initialize options = {}
  options = {:host => 'localhost', :port => 6379}.merge(options)
  @store = Redis.new options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



13
14
15
# File 'lib/irc/store.rb', line 13

def method_missing method_name, *args, &block
  store.send method_name, *args, &block
end

Class Attribute Details

.optionsObject

Returns the value of attribute options.



18
19
20
# File 'lib/irc/store.rb', line 18

def options
  @options
end

Instance Attribute Details

#storeObject (readonly)

Returns the value of attribute store.



6
7
8
# File 'lib/irc/store.rb', line 6

def store
  @store
end

Class Method Details

.storeObject



19
20
21
# File 'lib/irc/store.rb', line 19

def store
  self.new options
end