class Rung::Definition::Step

Attributes

action[R]
from_block[R]

Public Class Methods

new(action, from_block: false, run_on: :success, ignore_result: false, fail_fast: false) click to toggle source

rubocop:disable Metrics/LineLength

# File lib/rung/definition/step.rb, line 6
def initialize(action, from_block: false, run_on: :success, ignore_result: false, fail_fast: false)
  # rubocop:enable Metrics/LineLength
  @action = action
  @from_block = from_block
  @run_on = run_on
  @ignore_result = ignore_result
  @fail_fast = fail_fast
end

Public Instance Methods

fail_fast?() click to toggle source
# File lib/rung/definition/step.rb, line 38
def fail_fast?
  @fail_fast
end
ignore_result?() click to toggle source
# File lib/rung/definition/step.rb, line 34
def ignore_result?
  @ignore_result
end
nested?() click to toggle source
# File lib/rung/definition/step.rb, line 30
def nested?
  false
end
run?(success) click to toggle source
# File lib/rung/definition/step.rb, line 17
def run?(success)
  case @run_on
  when :success
    success
  when :failure
    !success
  when :any
    true
  else
    false
  end
end