Class: RSchema::ErrorDetails
- Inherits:
-
Struct
- Object
- Struct
- RSchema::ErrorDetails
- Defined in:
- lib/rschema.rb
Instance Attribute Summary collapse
-
#failing_value ⇒ Object
Returns the value of attribute failing_value.
-
#key_path ⇒ Object
Returns the value of attribute key_path.
-
#reason ⇒ Object
Returns the value of attribute reason.
Instance Method Summary collapse
- #extend_key_path(key) ⇒ Object
-
#initialize(failing_value, reason, key_path = []) ⇒ ErrorDetails
constructor
A new instance of ErrorDetails.
- #to_s ⇒ Object
Constructor Details
#initialize(failing_value, reason, key_path = []) ⇒ ErrorDetails
Returns a new instance of ErrorDetails.
8 9 10 |
# File 'lib/rschema.rb', line 8 def initialize(failing_value, reason, key_path = []) super(failing_value, reason, key_path) end |
Instance Attribute Details
#failing_value ⇒ Object
Returns the value of attribute failing_value
7 8 9 |
# File 'lib/rschema.rb', line 7 def failing_value @failing_value end |
#key_path ⇒ Object
Returns the value of attribute key_path
7 8 9 |
# File 'lib/rschema.rb', line 7 def key_path @key_path end |
#reason ⇒ Object
Returns the value of attribute reason
7 8 9 |
# File 'lib/rschema.rb', line 7 def reason @reason end |
Instance Method Details
#extend_key_path(key) ⇒ Object
17 18 19 20 |
# File 'lib/rschema.rb', line 17 def extend_key_path(key) key_path.unshift(key) self end |
#to_s ⇒ Object
12 13 14 15 |
# File 'lib/rschema.rb', line 12 def to_s prefix = (key_path.empty? ? 'The root value' : "The value at #{key_path.inspect}") "#{prefix} #{reason}: #{failing_value.inspect}" end |