Exception: MastodonAPI::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- MastodonAPI::APIError
- Defined in:
- app/mastodon_api.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ APIError
constructor
A new instance of APIError.
- #status ⇒ Object
Constructor Details
#initialize(response) ⇒ APIError
Returns a new instance of APIError.
15 16 17 18 |
# File 'app/mastodon_api.rb', line 15 def initialize(response) @response = response super("APIError #{response.code}: #{response.body}") end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
13 14 15 |
# File 'app/mastodon_api.rb', line 13 def response @response end |
Instance Method Details
#status ⇒ Object
20 21 22 |
# File 'app/mastodon_api.rb', line 20 def status response.code.to_i end |