Class: PlaidError

Inherits:
PlaidObject show all
Defined in:
lib/plaid/plaid_error.rb

Instance Method Summary collapse

Methods inherited from PlaidObject

#encode

Constructor Details

#initialize(response, message) ⇒ PlaidError

Returns a new instance of PlaidError.



9
10
11
12
13
14
15
16
17
# File 'lib/plaid/plaid_error.rb', line 9

def initialize(response, message)
  if response.parsed_response
    super(response.parsed_response)
  else
    super(response)
  end
  @response = response
  @message = message
end

Instance Method Details

#error_messageObject



19
20
21
# File 'lib/plaid/plaid_error.rb', line 19

def error_message
  self.message
end

#http_codeObject



23
24
25
# File 'lib/plaid/plaid_error.rb', line 23

def http_code
  @response.code if @response
end

#plaid_codeObject



27
28
29
# File 'lib/plaid/plaid_error.rb', line 27

def plaid_code
  response.code
end

#raw_responseObject



35
36
37
# File 'lib/plaid/plaid_error.rb', line 35

def raw_response
  @response if @response
end

#resolutionObject



31
32
33
# File 'lib/plaid/plaid_error.rb', line 31

def resolution
  self.resolve
end