Exception: Hyperwallet::HyperwalletError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hyperwallet/hyperwallet_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, http_status = nil, http_body = nil) ⇒ HyperwalletError

Returns a new instance of HyperwalletError.



3
4
5
6
7
# File 'lib/hyperwallet/hyperwallet_error.rb', line 3

def initialize(message=nil, http_status=nil, http_body=nil)
  @message = message
  @http_status = http_status
  @http_body = http_body
end

Instance Method Details

#to_sObject



9
10
11
12
# File 'lib/hyperwallet/hyperwallet_error.rb', line 9

def to_s
  status_string = @http_status.nil? ? "" : "(Status #{@http_status}) "
  "#{status_string}#{@message}"
end