Class: Definition::ConformResult
- Inherits:
-
Object
- Object
- Definition::ConformResult
- Defined in:
- lib/definition/conform_result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(value, errors: []) ⇒ ConformResult
constructor
A new instance of ConformResult.
- #passed? ⇒ Boolean
Constructor Details
#initialize(value, errors: []) ⇒ ConformResult
Returns a new instance of ConformResult.
5 6 7 8 |
# File 'lib/definition/conform_result.rb', line 5 def initialize(value, errors: []) self.value = value self.errors = errors end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
10 11 12 |
# File 'lib/definition/conform_result.rb', line 10 def errors @errors end |
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/definition/conform_result.rb', line 10 def value @value end |
Instance Method Details
#error_message ⇒ Object
16 17 18 |
# File 'lib/definition/conform_result.rb', line 16 def errors.map(&:message).join(", ") end |
#passed? ⇒ Boolean
12 13 14 |
# File 'lib/definition/conform_result.rb', line 12 def passed? errors.empty? end |