Class: Renoir::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/renoir/pipeline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Pipeline

Returns a new instance of Pipeline.



5
6
7
# File 'lib/renoir/pipeline.rb', line 5

def initialize(options={})
  @commands = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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

Delegated to #call.



22
23
24
# File 'lib/renoir/pipeline.rb', line 22

def method_missing(command, *args, &block)
  call(command, *args, &block)
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands.



3
4
5
# File 'lib/renoir/pipeline.rb', line 3

def commands
  @commands
end

Instance Method Details

#call(*command) ⇒ Object

Store a command for pipelining.

Parameters:

  • a (Array)

    Redis command passed to a connection backend



17
18
19
# File 'lib/renoir/pipeline.rb', line 17

def call(*command)
  @commands << command
end

#eval(*args) ⇒ Object

Delegated to #call.



10
11
12
# File 'lib/renoir/pipeline.rb', line 10

def eval(*args)
  call(:eval, *args)
end