Exception: Smartfm::RestClient::Base::RESTError

Inherits:
Exception
  • Object
show all
Defined in:
lib/smartfm/rest_clients/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ RESTError

Returns a new instance of RESTError.



8
9
10
11
# File 'lib/smartfm/rest_clients/base.rb', line 8

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

Instance Attribute Details

#codeObject

Returns the value of attribute code.



6
7
8
# File 'lib/smartfm/rest_clients/base.rb', line 6

def code
  @code
end

#messageObject

Returns the value of attribute message.



6
7
8
# File 'lib/smartfm/rest_clients/base.rb', line 6

def message
  @message
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/smartfm/rest_clients/base.rb', line 13

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