Class: Fawry::FawryResponse

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/fawry/fawry_response.rb

Constant Summary

Constants included from Utils

Utils::TRUTH_VALUES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#enrich_object

Constructor Details

#initialize(fawry_api_response) ⇒ FawryResponse

Returns a new instance of FawryResponse.



9
10
11
12
13
# File 'lib/fawry/fawry_response.rb', line 9

def initialize(fawry_api_response)
  @fawry_api_response = fawry_api_response

  build_response
end

Instance Attribute Details

#fawry_api_responseObject (readonly)

Returns the value of attribute fawry_api_response.



7
8
9
# File 'lib/fawry/fawry_response.rb', line 7

def fawry_api_response
  @fawry_api_response
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/fawry/fawry_response.rb', line 19

def failure?
  !success?
end

#fawry_api_response_bodyObject



23
24
25
# File 'lib/fawry/fawry_response.rb', line 23

def fawry_api_response_body
  fawry_api_response
end

#success?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/fawry/fawry_response.rb', line 15

def success?
  status_code == 200
end