Exception: RubyPsigate::ResponseError

Inherits:
RubyPsigateError show all
Defined in:
lib/ruby_psigate/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, message = nil) ⇒ ResponseError

Returns a new instance of ResponseError.



18
19
20
21
# File 'lib/ruby_psigate/error.rb', line 18

def initialize(response, message = nil)
  @response = response
  @message  = message
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



16
17
18
# File 'lib/ruby_psigate/error.rb', line 16

def response
  @response
end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/ruby_psigate/error.rb', line 23

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