Class: Docker::API::Response
- Inherits:
-
Excon::Response
- Object
- Excon::Response
- Docker::API::Response
- Defined in:
- lib/docker/api/response.rb
Overview
Reponse class.
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(data) ⇒ Response
constructor
Initialize a new Response object.
-
#success? ⇒ Boolean
Return true if Response status is in 200..204 range.
Constructor Details
#initialize(data) ⇒ Response
Initialize a new Response object.
10 11 12 13 14 |
# File 'lib/docker/api/response.rb', line 10 def initialize data super data @json = parse_json @body @path = @data[:path] end |
Instance Attribute Details
#json ⇒ Object (readonly)
Returns the value of attribute json.
4 5 6 |
# File 'lib/docker/api/response.rb', line 4 def json @json end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/docker/api/response.rb', line 4 def path @path end |
Instance Method Details
#success? ⇒ Boolean
Return true if Response status is in 200..204 range.
18 19 20 |
# File 'lib/docker/api/response.rb', line 18 def success? (200..204).include? @status end |