Class: Tangocard::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tangocard/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response) ⇒ Response

Returns a new instance of Response.


4
5
6
7
# File 'lib/tangocard/response.rb', line 4

def initialize(raw_response)
  @parsed_response = raw_response.parsed_response
  @code = raw_response.code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.


2
3
4
# File 'lib/tangocard/response.rb', line 2

def code
  @code
end

#parsed_responseObject (readonly)

Returns the value of attribute parsed_response.


2
3
4
# File 'lib/tangocard/response.rb', line 2

def parsed_response
  @parsed_response
end

Instance Method Details

#denial_codeObject


21
22
23
# File 'lib/tangocard/response.rb', line 21

def denial_code
  safe_response['denial_code']
end

#denial_messageObject


17
18
19
# File 'lib/tangocard/response.rb', line 17

def denial_message
  safe_response['denial_message']
end

#error_messageObject


13
14
15
# File 'lib/tangocard/response.rb', line 13

def error_message
  safe_response['error_message']
end

#invalid_inputsObject


25
26
27
# File 'lib/tangocard/response.rb', line 25

def invalid_inputs
  safe_response['invalid_inputs']
end

#success?Boolean

Returns:

  • (Boolean)

9
10
11
# File 'lib/tangocard/response.rb', line 9

def success?
  safe_response['success'] || false
end