Class: MultiRedis::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/multi_redis/step.rb

Instance Method Summary collapse

Constructor Details

#initialize(target, type, block) ⇒ Step

Returns a new instance of Step.


5
6
7
# File 'lib/multi_redis/step.rb', line 5

def initialize target, type, block
  @target, @type, @block = target, type, block
end

Instance Method Details

#execute(context, *args) ⇒ Object


9
10
11
# File 'lib/multi_redis/step.rb', line 9

def execute context, *args
  @target.instance_exec *args.unshift(context), &@block
end

#typeObject


13
14
15
# File 'lib/multi_redis/step.rb', line 13

def type
  @type
end