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.
114 115 116 117 118 119 120 121 |
# File 'lib/odin/types/errors.rb', line 114 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.
112 113 114 |
# File 'lib/odin/types/errors.rb', line 112 def actual @actual end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
112 113 114 |
# File 'lib/odin/types/errors.rb', line 112 def code @code end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
112 113 114 |
# File 'lib/odin/types/errors.rb', line 112 def expected @expected end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
112 113 114 |
# File 'lib/odin/types/errors.rb', line 112 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
112 113 114 |
# File 'lib/odin/types/errors.rb', line 112 def path @path end |
#schema_path ⇒ Object (readonly)
Returns the value of attribute schema_path.
112 113 114 |
# File 'lib/odin/types/errors.rb', line 112 def schema_path @schema_path end |
Instance Method Details
#to_s ⇒ Object
123 124 125 |
# File 'lib/odin/types/errors.rb', line 123 def to_s "[#{code}] #{} at '#{path}'" end |