Class: RailsWorkflow::ErrorBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_workflow/error_builder.rb

Overview

Default error builder. Can be changed in configuration. Manages errors building

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, context) ⇒ ErrorBuilder

Returns a new instance of ErrorBuilder.



13
14
15
16
# File 'lib/rails_workflow/error_builder.rb', line 13

def initialize(exception, context)
  @exception = exception
  @context = context
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



7
8
9
# File 'lib/rails_workflow/error_builder.rb', line 7

def context
  @context
end

#exceptionObject

Returns the value of attribute exception.



7
8
9
# File 'lib/rails_workflow/error_builder.rb', line 7

def exception
  @exception
end

Class Method Details

.handle(exception, context) ⇒ Object



9
10
11
# File 'lib/rails_workflow/error_builder.rb', line 9

def self.handle(exception, context)
  new(exception, context).handle
end

Instance Method Details

#handleObject



18
19
20
21
# File 'lib/rails_workflow/error_builder.rb', line 18

def handle
  create_error(context)
  process_parent(target)
end