Exception: Iknow::RestClient::Base::RESTError

Inherits:
Exception
  • Object
show all
Defined in:
lib/iknow/rest_client/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ RESTError

Returns a new instance of RESTError.



6
7
8
9
10
# File 'lib/iknow/rest_client/base.rb', line 6

def initialize(params = {})
  self.code    = params[:code]
  self.message = params[:message]
  self.uri     = params[:uri]
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



4
5
6
# File 'lib/iknow/rest_client/base.rb', line 4

def code
  @code
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/iknow/rest_client/base.rb', line 4

def message
  @message
end

#uriObject

Returns the value of attribute uri.



4
5
6
# File 'lib/iknow/rest_client/base.rb', line 4

def uri
  @uri
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/iknow/rest_client/base.rb', line 12

def to_s
  "HTTP #{@code}: #{@message} at #{@uri}"
end