Class: Floe::Workflow::Catcher

Inherits:
Object
  • Object
show all
Includes:
ValidationMixin, ErrorMatcherMixin
Defined in:
lib/floe/workflow/catcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValidationMixin

included, #invalid_field_error!, #missing_field_error!, #parser_error!, #runtime_field_error!, #workflow_state?, #wrap_parser_error

Methods included from ErrorMatcherMixin

#match_error?

Constructor Details

#initialize(workflow, name, payload) ⇒ Catcher

Returns a new instance of Catcher.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/floe/workflow/catcher.rb', line 11

def initialize(workflow, name, payload)
  @name         = name
  @payload      = payload

  @error_equals = payload["ErrorEquals"]
  @next         = payload["Next"]
  @result_path  = ReferencePath.new(payload.fetch("ResultPath", "$"))

  missing_field_error!("ErrorEquals") if !@error_equals.kind_of?(Array) || @error_equals.empty?
  validate_state_next!(workflow)
end

Instance Attribute Details

#error_equalsObject (readonly)

Returns the value of attribute error_equals.



9
10
11
# File 'lib/floe/workflow/catcher.rb', line 9

def error_equals
  @error_equals
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/floe/workflow/catcher.rb', line 9

def name
  @name
end

#nextObject (readonly)

Returns the value of attribute next.



9
10
11
# File 'lib/floe/workflow/catcher.rb', line 9

def next
  @next
end

#result_pathObject (readonly)

Returns the value of attribute result_path.



9
10
11
# File 'lib/floe/workflow/catcher.rb', line 9

def result_path
  @result_path
end