Class: Retab::ValidationError
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ValidationError
- Defined in:
- lib/retab/shared/validation_error.rb
Constant Summary collapse
- HASH_ATTRS =
{ loc: :loc, msg: :msg, type: :type, input: :input, ctx: :ctx }.freeze
Instance Attribute Summary collapse
-
#ctx ⇒ Object
Returns the value of attribute ctx.
-
#input ⇒ Object
Returns the value of attribute input.
-
#loc ⇒ Object
Returns the value of attribute loc.
-
#msg ⇒ Object
Returns the value of attribute msg.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ValidationError
constructor
A new instance of ValidationError.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ValidationError
Returns a new instance of ValidationError.
23 24 25 26 27 28 29 30 |
# File 'lib/retab/shared/validation_error.rb', line 23 def initialize(json) hash = self.class.normalize(json) @loc = (hash[:loc] || []) @msg = hash[:msg] @type = hash[:type] @input = hash[:input] @ctx = hash[:ctx] || {} end |
Instance Attribute Details
#ctx ⇒ Object
Returns the value of attribute ctx.
16 17 18 |
# File 'lib/retab/shared/validation_error.rb', line 16 def ctx @ctx end |
#input ⇒ Object
Returns the value of attribute input.
16 17 18 |
# File 'lib/retab/shared/validation_error.rb', line 16 def input @input end |
#loc ⇒ Object
Returns the value of attribute loc.
16 17 18 |
# File 'lib/retab/shared/validation_error.rb', line 16 def loc @loc end |
#msg ⇒ Object
Returns the value of attribute msg.
16 17 18 |
# File 'lib/retab/shared/validation_error.rb', line 16 def msg @msg end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/retab/shared/validation_error.rb', line 16 def type @type end |