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.



23
24
25
26
27
28
29
# File 'lib/rainforest_ruby_runtime/test.rb', line 23

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.



21
22
23
# File 'lib/rainforest_ruby_runtime/test.rb', line 21

def action
  @action
end

#idObject (readonly)

Returns the value of attribute id.



21
22
23
# File 'lib/rainforest_ruby_runtime/test.rb', line 21

def id
  @id
end

#responseObject (readonly)

Returns the value of attribute response.



21
22
23
# File 'lib/rainforest_ruby_runtime/test.rb', line 21

def response
  @response
end

Instance Method Details

#runObject



31
32
33
34
35
# File 'lib/rainforest_ruby_runtime/test.rb', line 31

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