Class: Dry::Validation::Error
- Inherits:
-
Object
- Object
- Dry::Validation::Error
- Defined in:
- lib/dry/validation/error.rb
Defined Under Namespace
Classes: Set
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result) ⇒ Error
constructor
A new instance of Error.
- #to_ary ⇒ Object (also: #to_a)
Constructor Details
#initialize(result) ⇒ Error
Returns a new instance of Error.
29 30 31 |
# File 'lib/dry/validation/error.rb', line 29 def initialize(result) @result = result end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
27 28 29 |
# File 'lib/dry/validation/error.rb', line 27 def result @result end |
Instance Method Details
#to_ary ⇒ Object Also known as: to_a
33 34 35 |
# File 'lib/dry/validation/error.rb', line 33 def to_ary [:error, result.to_ary] end |