Class: CircleCi::Response
- Inherits:
-
Object
- Object
- CircleCi::Response
- Extended by:
- Forwardable
- Defined in:
- lib/circleci/response.rb
Overview
Response class is used to get access to raw HTTP request info
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(resp) ⇒ Response
constructor
Initializing response object to be returned from API calls, used internally.
-
#success? ⇒ Boolean
Convenience method to determine if request was successfull or not.
Constructor Details
#initialize(resp) ⇒ Response
Initializing response object to be returned from API calls, used internally.
19 20 21 22 |
# File 'lib/circleci/response.rb', line 19 def initialize(resp) # @private @resp = resp @body = parsed_body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
13 14 15 |
# File 'lib/circleci/response.rb', line 13 def body @body end |
Instance Method Details
#success? ⇒ Boolean
Convenience method to determine if request was successfull or not
28 29 30 31 32 33 34 |
# File 'lib/circleci/response.rb', line 28 def success? case @resp.code.to_i when (200..299) then true else false end end |