Class: Ecertic::Response
- Inherits:
-
Object
- Object
- Ecertic::Response
- Defined in:
- lib/ecertic/response.rb
Instance Attribute Summary collapse
-
#http_response ⇒ Object
readonly
Returns the value of attribute http_response.
Class Method Summary collapse
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(http_response) ⇒ Response
constructor
A new instance of Response.
- #raw_body ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(http_response) ⇒ Response
Returns a new instance of Response.
7 8 9 |
# File 'lib/ecertic/response.rb', line 7 def initialize(http_response) @http_response = http_response end |
Instance Attribute Details
#http_response ⇒ Object (readonly)
Returns the value of attribute http_response.
5 6 7 |
# File 'lib/ecertic/response.rb', line 5 def http_response @http_response end |
Class Method Details
.from_faraday_response(faraday_response) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/ecertic/response.rb', line 27 def self.from_faraday_response(faraday_response) http_response = { body: faraday_response.body, raw_body: faraday_response.env[:raw_body], headers: faraday_response.headers, status: faraday_response.status, } new(http_response) end |
Instance Method Details
#body ⇒ Object
11 12 13 |
# File 'lib/ecertic/response.rb', line 11 def body http_response[:body] end |
#headers ⇒ Object
19 20 21 |
# File 'lib/ecertic/response.rb', line 19 def headers http_response[:headers] end |
#raw_body ⇒ Object
15 16 17 |
# File 'lib/ecertic/response.rb', line 15 def raw_body http_response[:raw_body] end |
#status ⇒ Object
23 24 25 |
# File 'lib/ecertic/response.rb', line 23 def status http_response[:status] end |