Exception: MastodonAPI::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
app/mastodon_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject (readonly)

Returns the value of attribute response.



13
14
15
# File 'app/mastodon_api.rb', line 13

def response
  @response
end

Instance Method Details

#statusObject



20
21
22
# File 'app/mastodon_api.rb', line 20

def status
  response.code.to_i
end