Class: RainforestRubyRuntime::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/rainforest_ruby_runtime/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, action:, response:, callback:, &block) ⇒ Step

Returns a new instance of Step.



40
41
42
43
44
45
46
# File 'lib/rainforest_ruby_runtime/test.rb', line 40

def initialize(id: , action: , response: , callback: , &block)
  @id = id
  @action = action
  @response = response
  @block = block
  @callback = callback
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



38
39
40
# File 'lib/rainforest_ruby_runtime/test.rb', line 38

def action
  @action
end

#idObject (readonly)

Returns the value of attribute id.



38
39
40
# File 'lib/rainforest_ruby_runtime/test.rb', line 38

def id
  @id
end

#responseObject (readonly)

Returns the value of attribute response.



38
39
40
# File 'lib/rainforest_ruby_runtime/test.rb', line 38

def response
  @response
end

Instance Method Details

#runObject



48
49
50
51
52
# File 'lib/rainforest_ruby_runtime/test.rb', line 48

def run
  @callback.before_step(self)
  @block.call
  @callback.after_step(self)
end