class GoCardless::Error

A class to represent an API Error

Attributes

error[R]

Public Class Methods

new(error) click to toggle source

intialize a new error  @param error the error from the API

# File lib/gocardless-pro/error.rb, line 8
def initialize(error)
  @error = error
end

Public Instance Methods

code() click to toggle source

access the code from the response

# File lib/gocardless-pro/error.rb, line 28
def code
  @error['code']
end
documentation_url() click to toggle source

access the documentation_url from the response

# File lib/gocardless-pro/error.rb, line 13
def documentation_url
  @error['documentation_url']
end
errors() click to toggle source

access the errors from the response

# File lib/gocardless-pro/error.rb, line 38
def errors
  @error['errors']
end
message() click to toggle source

access the message from the response

# File lib/gocardless-pro/error.rb, line 18
def message
  @error['message']
end
request_id() click to toggle source

access the request_id from the response

# File lib/gocardless-pro/error.rb, line 33
def request_id
  @error['request_id']
end
type() click to toggle source

access the type from the response

# File lib/gocardless-pro/error.rb, line 23
def type
  @error['type']
end