Class: Fog::Compute::Fogdocker::Image

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/fogdocker/models/compute/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#infoObject

Returns the value of attribute info.



7
8
9
# File 'lib/fog/fogdocker/models/compute/image.rb', line 7

def info
  @info
end

Instance Method Details

#destroy(options = {}) ⇒ Object



22
23
24
# File 'lib/fog/fogdocker/models/compute/image.rb', line 22

def destroy(options = {})
  service.image_delete(id)
end

#nameObject



14
15
16
# File 'lib/fog/fogdocker/models/compute/image.rb', line 14

def name
  repo_tags.empty? ? id : repo_tags.first
end

#ready?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/fog/fogdocker/models/compute/image.rb', line 18

def ready?
  !(status =~ /down/i)
end

#saveObject

Raises:

  • (Fog::Errors::Error)


26
27
28
29
# File 'lib/fog/fogdocker/models/compute/image.rb', line 26

def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  service.image_create(attributes)
end

#to_sObject



31
32
33
# File 'lib/fog/fogdocker/models/compute/image.rb', line 31

def to_s
  name
end