Exception: JSONModel::ValidationException
- Inherits:
-
StandardError
- Object
- StandardError
- JSONModel::ValidationException
- Defined in:
- common/jsonmodel.rb
Instance Attribute Summary collapse
-
#attribute_types ⇒ Object
Returns the value of attribute attribute_types.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#import_context ⇒ Object
Returns the value of attribute import_context.
-
#invalid_object ⇒ Object
Returns the value of attribute invalid_object.
-
#object_context ⇒ Object
Returns the value of attribute object_context.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(opts) ⇒ ValidationException
constructor
A new instance of ValidationException.
-
#to_s ⇒ Object
Constructor Details
#initialize(opts) ⇒ ValidationException
Returns a new instance of ValidationException.
43 44 45 46 47 48 49 50 |
# File 'common/jsonmodel.rb', line 43 def initialize(opts) @invalid_object = opts[:invalid_object] @errors = opts[:errors] @warnings = opts[:warnings] @import_context = opts[:import_context] @object_context = opts[:object_context] @attribute_types = opts[:attribute_types] end |
Instance Attribute Details
#attribute_types ⇒ Object
Returns the value of attribute attribute_types
39 40 41 |
# File 'common/jsonmodel.rb', line 39 def attribute_types @attribute_types end |
#errors ⇒ Object
Returns the value of attribute errors
37 38 39 |
# File 'common/jsonmodel.rb', line 37 def errors @errors end |
#import_context ⇒ Object
Returns the value of attribute import_context
40 41 42 |
# File 'common/jsonmodel.rb', line 40 def import_context @import_context end |
#invalid_object ⇒ Object
Returns the value of attribute invalid_object
36 37 38 |
# File 'common/jsonmodel.rb', line 36 def invalid_object @invalid_object end |
#object_context ⇒ Object
Returns the value of attribute object_context
41 42 43 |
# File 'common/jsonmodel.rb', line 41 def object_context @object_context end |
#warnings ⇒ Object
Returns the value of attribute warnings
38 39 40 |
# File 'common/jsonmodel.rb', line 38 def warnings @warnings end |
Instance Method Details
#to_s ⇒ Object
52 53 54 55 56 57 |
# File 'common/jsonmodel.rb', line 52 def to_s msg = { :errors => @errors } msg[:import_context] = @import_context unless @import_context.nil? msg[:object_context] = @object_context unless @object_context.nil? "#<:ValidationException: #{msg.inspect}>" end |