Class: Credigy::Response
- Inherits:
-
Object
- Object
- Credigy::Response
- Extended by:
- Forwardable
- Defined in:
- lib/credigy/response.rb
Direct Known Subclasses
AccountResponse, AgreementExceptionStatusResponse, BoletoResponse, CampaignNegotiationResponse, EmailCreationResponse, EmailResponse, InstallmentResponse, LegalTermsAcceptanceResponse, LineResponse, LoginResponse, PromiseResponse, ProviderResponse
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
-
#requester ⇒ Object
readonly
Returns the value of attribute requester.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(raw_response, requester) ⇒ Response
constructor
A new instance of Response.
- #root_key ⇒ Object
- #sub_root_key ⇒ Object
Constructor Details
#initialize(raw_response, requester) ⇒ Response
Returns a new instance of Response.
8 9 10 11 |
# File 'lib/credigy/response.rb', line 8 def initialize(raw_response, requester) @raw_response = raw_response @requester = requester end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
6 7 8 |
# File 'lib/credigy/response.rb', line 6 def raw_response @raw_response end |
#requester ⇒ Object (readonly)
Returns the value of attribute requester.
6 7 8 |
# File 'lib/credigy/response.rb', line 6 def requester @requester end |
Instance Method Details
#body ⇒ Object
13 14 15 |
# File 'lib/credigy/response.rb', line 13 def body raw_response.body[root_key][sub_root_key] end |
#root_key ⇒ Object
17 18 19 |
# File 'lib/credigy/response.rb', line 17 def root_key "#{requester.operation}_response".to_sym end |
#sub_root_key ⇒ Object
21 22 23 |
# File 'lib/credigy/response.rb', line 21 def sub_root_key "#{requester.operation}_result".to_sym end |