Class: DockerCloud::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/docker_cloud/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, client) ⇒ Type

Returns a new instance of Type.



5
6
7
8
9
10
# File 'lib/docker_cloud/type.rb', line 5

def initialize(response, client)
  @info = response
  @client = client
  @uuid = info[:uuid]
  @resource_uri = info[:uuid]
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



3
4
5
# File 'lib/docker_cloud/type.rb', line 3

def info
  @info
end

Instance Method Details

#reloadObject



12
13
14
15
# File 'lib/docker_cloud/type.rb', line 12

def reload
  refreshed = api.get_from_uri(resource_uri)
  @info = refreshed.info
end

#resource_uriObject



21
22
23
# File 'lib/docker_cloud/type.rb', line 21

def resource_uri
  info[:resource_uri]
end

#uuidObject



17
18
19
# File 'lib/docker_cloud/type.rb', line 17

def uuid
  info[:uuid]
end