Class: Dry::Transaction::StepFailure
- Inherits:
-
Object
- Object
- Dry::Transaction::StepFailure
- Defined in:
- lib/dry/transaction/step_failure.rb
Overview
A wrapper for storing together the step that failed and value describing the failure.
Instance Attribute Summary collapse
-
#step ⇒ Object
readonly
Returns the value of attribute step.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .call(step, value) ⇒ Object private
Instance Method Summary collapse
-
#initialize(step, value) ⇒ StepFailure
constructor
A new instance of StepFailure.
Constructor Details
#initialize(step, value) ⇒ StepFailure
Returns a new instance of StepFailure.
19 20 21 22 |
# File 'lib/dry/transaction/step_failure.rb', line 19 def initialize(step, value) @step = step @value = value end |
Instance Attribute Details
#step ⇒ Object (readonly)
Returns the value of attribute step.
6 7 8 |
# File 'lib/dry/transaction/step_failure.rb', line 6 def step @step end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/dry/transaction/step_failure.rb', line 7 def value @value end |
Class Method Details
.call(step, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 17 |
# File 'lib/dry/transaction/step_failure.rb', line 10 def self.call(step, value) if self === value value else yield new(step, value) end end |