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.



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

#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

Instance Method Details

#success?Boolean

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

Returns:

  • (Boolean)


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

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