Class: EasybillRestClient::Response
- Inherits:
-
Object
- Object
- EasybillRestClient::Response
- Defined in:
- lib/easybill_rest_client/response.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/easybill_rest_client/response.rb', line 5 def initialize(response) @response = response end |
Instance Method Details
#body ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/easybill_rest_client/response.rb', line 9 def body body = extract_response_body(response) unless response.is_a?(Net::HTTPSuccess) raise ApiError, body.inspect end body && !body.empty? ? body : nil end |