Class: Fog::Compute::Brightbox::Image
- Defined in:
- lib/fog/brightbox/models/compute/image.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
55 56 57 58 59 |
# File 'lib/fog/brightbox/models/compute/image.rb', line 55 def destroy requires :identity connection.destroy_image(identity) true end |
#ready? ⇒ Boolean
36 37 38 |
# File 'lib/fog/brightbox/models/compute/image.rb', line 36 def ready? status == "available" end |
#save ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fog/brightbox/models/compute/image.rb', line 40 def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity requires :source, :arch = { :source => source, :arch => arch, :name => name, :username => username, :description => description }.delete_if {|k,v| v.nil? || v == "" } data = connection.create_image() merge_attributes(data) true end |