Module: Yaso::Stepable

Included in:
Service
Defined in:
lib/yaso/stepable.rb

Instance Method Summary collapse

Instance Method Details

#failure(object, **options, &block) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/yaso/stepable.rb', line 18

def failure(object, **options, &block)
  raise InvalidFirstStepError, :failure if flow == Logic::Classic && steps.empty?

  steps << {
    object: object, category: :failure, fast: options.delete(:fast), on_success: options.delete(:on_success),
    on_failure: options.delete(:on_failure), options: options, block: block, name: options.delete(:name)
  }
end

#stepsObject



5
6
7
# File 'lib/yaso/stepable.rb', line 5

def steps
  @steps ||= []
end