Class: Odin::Errors::ValidationError
- Inherits:
-
Object
- Object
- Odin::Errors::ValidationError
- Defined in:
- lib/odin/types/errors.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#schema_path ⇒ Object
readonly
Returns the value of attribute schema_path.
Instance Method Summary collapse
-
#initialize(code:, path:, message:, expected: nil, actual: nil, schema_path: nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #to_s ⇒ Object
Constructor Details
#initialize(code:, path:, message:, expected: nil, actual: nil, schema_path: nil) ⇒ ValidationError
Returns a new instance of ValidationError.
106 107 108 109 110 111 112 113 |
# File 'lib/odin/types/errors.rb', line 106 def initialize(code:, path:, message:, expected: nil, actual: nil, schema_path: nil) @code = code @path = path @message = @expected = expected @actual = actual @schema_path = schema_path end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
104 105 106 |
# File 'lib/odin/types/errors.rb', line 104 def actual @actual end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
104 105 106 |
# File 'lib/odin/types/errors.rb', line 104 def code @code end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
104 105 106 |
# File 'lib/odin/types/errors.rb', line 104 def expected @expected end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
104 105 106 |
# File 'lib/odin/types/errors.rb', line 104 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
104 105 106 |
# File 'lib/odin/types/errors.rb', line 104 def path @path end |
#schema_path ⇒ Object (readonly)
Returns the value of attribute schema_path.
104 105 106 |
# File 'lib/odin/types/errors.rb', line 104 def schema_path @schema_path end |
Instance Method Details
#to_s ⇒ Object
115 116 117 |
# File 'lib/odin/types/errors.rb', line 115 def to_s "[#{code}] #{} at '#{path}'" end |