Class: Fugle::HTTP::Error::Body Private
- Inherits:
-
Object
- Object
- Fugle::HTTP::Error::Body
- Defined in:
- lib/fugle/http/error.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #code ⇒ Object readonly private
- #message ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(error) ⇒ Body
constructor
private
A new instance of Body.
-
#to_h ⇒ Hash
private
Convert to Hash.
-
#to_json(*args) ⇒ String
private
Convert to JSON.
Constructor Details
#initialize(error) ⇒ Body
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Body.
58 59 60 61 |
# File 'lib/fugle/http/error.rb', line 58 def initialize(error) @code = error['code'] @message = error['message'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 |
# File 'lib/fugle/http/error.rb', line 54 def code @code end |
#message ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 |
# File 'lib/fugle/http/error.rb', line 54 def @message end |
Instance Method Details
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert to Hash
69 70 71 72 73 74 |
# File 'lib/fugle/http/error.rb', line 69 def to_h { code: @code, message: @message } end |
#to_json(*args) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convert to JSON
82 83 84 |
# File 'lib/fugle/http/error.rb', line 82 def to_json(*args) to_h.to_json(*args) end |