Class: Fugle::HTTP::Error Private
- Inherits:
-
Object
- Object
- Fugle::HTTP::Error
- Extended by:
- Forwardable
- 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.
Defined Under Namespace
Classes: Body
Instance Attribute Summary collapse
- #body ⇒ Object readonly private
- #info ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(api, body) ⇒ Error
constructor
private
A new instance of Error.
-
#to_h ⇒ Hash
private
Convert to Hash.
-
#to_json(*args) ⇒ String
private
Convert to JSON.
Constructor Details
#initialize(api, body) ⇒ Error
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 Error.
20 21 22 23 24 |
# File 'lib/fugle/http/error.rb', line 20 def initialize(api, body) @api = api @version = body['apiVersion'] @body = Body.new(body['error']) end |
Instance Attribute Details
#body ⇒ 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.
16 17 18 |
# File 'lib/fugle/http/error.rb', line 16 def body @body end |
#info ⇒ 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.
16 17 18 |
# File 'lib/fugle/http/error.rb', line 16 def info @info 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
32 33 34 35 36 37 |
# File 'lib/fugle/http/error.rb', line 32 def to_h { version: @version, body: @body } 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
45 46 47 |
# File 'lib/fugle/http/error.rb', line 45 def to_json(*args) to_h.to_json(*args) end |