Exception: Typekit::Client::APIError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/typekit/client.rb

Overview

TODO:

Put this somewhere better than Typekit::Client

Direct Known Subclasses

ResourceDoesNotExistError, ServiceError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Returns a new instance of APIError.



119
120
121
# File 'lib/typekit/client.rb', line 119

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



117
118
119
# File 'lib/typekit/client.rb', line 117

def response
  @response
end

Instance Method Details

#to_sObject



123
124
125
# File 'lib/typekit/client.rb', line 123

def to_s
  @response['errors'].first if @response['errors'].any?
end