Exception: Youtube::ProblemDetailsException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Youtube::ProblemDetailsException
- Defined in:
- lib/youtube/exceptions/problem_details_exception.rb
Overview
ProblemDetails class.
Instance Attribute Summary collapse
-
#status ⇒ Integer
readonly
TODO: Write general description for this method.
-
#title ⇒ String
readonly
TODO: Write general description for this method.
-
#trace_id ⇒ String
readonly
TODO: Write general description for this method.
-
#type ⇒ String
readonly
TODO: Write general description for this method.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ ProblemDetailsException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ ProblemDetailsException
The constructor.
28 29 30 31 32 |
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 28 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#status ⇒ Integer (readonly)
TODO: Write general description for this method
19 20 21 |
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 19 def status @status end |
#title ⇒ String (readonly)
TODO: Write general description for this method
15 16 17 |
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 15 def title @title end |
#trace_id ⇒ String (readonly)
TODO: Write general description for this method
23 24 25 |
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 23 def trace_id @trace_id end |
#type ⇒ String (readonly)
TODO: Write general description for this method
11 12 13 |
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 11 def type @type end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
37 38 39 40 41 42 |
# File 'lib/youtube/exceptions/problem_details_exception.rb', line 37 def unbox(hash) @type = hash['type'] @title = hash['title'] @status = hash['status'] @trace_id = hash['traceId'] end |