Class: Esignatur::Api::Response
- Inherits:
-
Object
- Object
- Esignatur::Api::Response
- Defined in:
- lib/esignatur/api/response.rb
Overview
api response wrapper
Instance Attribute Summary collapse
-
#original_response ⇒ Object
readonly
Returns the value of attribute original_response.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(original_response) ⇒ Response
constructor
A new instance of Response.
- #json_body ⇒ Object
- #method_missing(method_name, *args) ⇒ Object
- #respond_to_missing?(method_name, *args) ⇒ Boolean
Constructor Details
#initialize(original_response) ⇒ Response
Returns a new instance of Response.
9 10 11 |
# File 'lib/esignatur/api/response.rb', line 9 def initialize(original_response) @original_response = original_response end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
21 22 23 |
# File 'lib/esignatur/api/response.rb', line 21 def method_missing(method_name, *args) original_respond_to?(method_name, *args) ? original_response.public_send(method_name, *args) : super end |
Instance Attribute Details
#original_response ⇒ Object (readonly)
Returns the value of attribute original_response.
7 8 9 |
# File 'lib/esignatur/api/response.rb', line 7 def original_response @original_response end |
Instance Method Details
#body ⇒ Object
13 14 15 |
# File 'lib/esignatur/api/response.rb', line 13 def body original_response.body end |
#json_body ⇒ Object
17 18 19 |
# File 'lib/esignatur/api/response.rb', line 17 def json_body JSON.parse(body) end |
#respond_to_missing?(method_name, *args) ⇒ Boolean
25 26 27 |
# File 'lib/esignatur/api/response.rb', line 25 def respond_to_missing?(method_name, *args) original_respond_to?(method_name, *args) || super end |