Class: Docker::API::Response

Inherits:
Excon::Response
  • Object
show all
Defined in:
lib/docker/api/response.rb

Overview

Reponse class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Response

Initialize a new Response object.



11
12
13
14
15
# File 'lib/docker/api/response.rb', line 11

def initialize data
    super data
    @json = parse_json @body
    @path = @data[:path]
end

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



4
5
6
# File 'lib/docker/api/response.rb', line 4

def json
  @json
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/docker/api/response.rb', line 4

def path
  @path
end

#request_paramsObject

Returns the value of attribute request_params.



5
6
7
# File 'lib/docker/api/response.rb', line 5

def request_params
  @request_params
end

Instance Method Details

#success?Boolean

Return true if Response status is in 200..204 range.

Returns:

  • (Boolean)


19
20
21
# File 'lib/docker/api/response.rb', line 19

def success?
    (200..204).include? @status
end