Exception: Network::ResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/network/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseError

Returns a new instance of ResponseError.



7
8
9
# File 'lib/network/connection.rb', line 7

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/network/connection.rb', line 6

def response
  @response
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/network/connection.rb', line 11

def to_s
  "Failed with #{@response.code} #{@response.message if @response.respond_to?(:message)}"
end