Exception: Transferwise::TransferwiseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/transferwise/transferwise_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ TransferwiseError

Returns a new instance of TransferwiseError.



12
13
14
15
16
# File 'lib/transferwise/transferwise_error.rb', line 12

def initialize(params = {})
  params.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#http_bodyObject (readonly)

Returns the value of attribute http_body.



10
11
12
# File 'lib/transferwise/transferwise_error.rb', line 10

def http_body
  @http_body
end

#http_headersObject (readonly)

Returns the value of attribute http_headers.



10
11
12
# File 'lib/transferwise/transferwise_error.rb', line 10

def http_headers
  @http_headers
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



10
11
12
# File 'lib/transferwise/transferwise_error.rb', line 10

def http_status
  @http_status
end

#json_bodyObject (readonly)

Returns the value of attribute json_body.



10
11
12
# File 'lib/transferwise/transferwise_error.rb', line 10

def json_body
  @json_body
end

#messageObject (readonly)

Returns the value of attribute message.



10
11
12
# File 'lib/transferwise/transferwise_error.rb', line 10

def message
  @message
end

Instance Method Details

#to_sObject



18
19
20
21
# File 'lib/transferwise/transferwise_error.rb', line 18

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