Class: RailsWorkflow::ErrorBuilder
- Inherits:
-
Object
- Object
- RailsWorkflow::ErrorBuilder
- Defined in:
- lib/rails_workflow/error_builder.rb
Overview
Default error builder. Can be changed in configuration. Manages errors building
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#exception ⇒ Object
Returns the value of attribute exception.
Class Method Summary collapse
Instance Method Summary collapse
- #handle ⇒ Object
-
#initialize(exception, context) ⇒ ErrorBuilder
constructor
A new instance of ErrorBuilder.
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
#context ⇒ Object
Returns the value of attribute context.
7 8 9 |
# File 'lib/rails_workflow/error_builder.rb', line 7 def context @context end |
#exception ⇒ Object
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
#handle ⇒ Object
18 19 20 21 |
# File 'lib/rails_workflow/error_builder.rb', line 18 def handle create_error(context) process_parent(target) end |