Class: Fog::Compute::OpenStack::Image
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::OpenStack::Image
- Defined in:
- lib/fog/openstack/models/compute/image.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ Image
constructor
A new instance of Image.
- #metadata ⇒ Object
- #metadata=(new_metadata = {}) ⇒ Object
- #ready? ⇒ Boolean
Constructor Details
#initialize(attributes) ⇒ Image
Returns a new instance of Image.
21 22 23 24 25 |
# File 'lib/fog/openstack/models/compute/image.rb', line 21 def initialize(attributes) # Old 'connection' is renamed as service and should be used instead prepare_service_value(attributes) super end |
Instance Method Details
#destroy ⇒ Object
42 43 44 45 46 |
# File 'lib/fog/openstack/models/compute/image.rb', line 42 def destroy requires :id service.delete_image(id) true end |
#metadata ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/fog/openstack/models/compute/image.rb', line 27 def @metadata ||= begin Fog::Compute::OpenStack::Metadata.new({ :service => service, :parent => self }) end end |
#metadata=(new_metadata = {}) ⇒ Object
36 37 38 39 40 |
# File 'lib/fog/openstack/models/compute/image.rb', line 36 def (={}) = [] .each_pair {|k,v| << {"key" => k, "value" => v} } .load() end |
#ready? ⇒ Boolean
48 49 50 |
# File 'lib/fog/openstack/models/compute/image.rb', line 48 def ready? status == 'ACTIVE' end |