Exception: Tester::NestedModelException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Tester::NestedModelException
- Defined in:
- lib/tester/exceptions/nested_model_exception.rb
Overview
NestedModelException class.
Instance Attribute Summary collapse
-
#model ⇒ Validate
TODO: Write general description for this method.
-
#server_code ⇒ String
TODO: Write general description for this method.
-
#server_message ⇒ String
TODO: Write general description for this method.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, context) ⇒ NestedModelException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, context) ⇒ NestedModelException
The constructor.
22 23 24 25 26 |
# File 'lib/tester/exceptions/nested_model_exception.rb', line 22 def initialize(reason, context) super(reason, context) hash = APIHelper.json_deserialize(@context.response.raw_body) unbox(hash) end |
Instance Attribute Details
#model ⇒ Validate
TODO: Write general description for this method
17 18 19 |
# File 'lib/tester/exceptions/nested_model_exception.rb', line 17 def model @model end |
#server_code ⇒ String
TODO: Write general description for this method
13 14 15 |
# File 'lib/tester/exceptions/nested_model_exception.rb', line 13 def server_code @server_code end |
#server_message ⇒ String
TODO: Write general description for this method
9 10 11 |
# File 'lib/tester/exceptions/nested_model_exception.rb', line 9 def @server_message end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
31 32 33 34 35 |
# File 'lib/tester/exceptions/nested_model_exception.rb', line 31 def unbox(hash) @server_message = hash['ServerMessage'] @server_code = hash['ServerCode'] @model = Validate.from_hash(hash['model']) if hash['model'] end |