Exception: Spreedly::UnexpectedResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/spreedly/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ UnexpectedResponseError


39
40
41
# File 'lib/spreedly/error.rb', line 39

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response


37
38
39
# File 'lib/spreedly/error.rb', line 37

def response
  @response
end

Instance Method Details

#to_sObject


43
44
45
# File 'lib/spreedly/error.rb', line 43

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