Class: Fog::Compute::Ovirt::Template

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #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(options = {}) ⇒ Object



25
26
27
# File 'lib/fog/ovirt/models/compute/template.rb', line 25

def destroy(options = {})
  connection.client.destroy_template(id)
end

#ready?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/fog/ovirt/models/compute/template.rb', line 21

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

#saveObject

Raises:



29
30
31
32
# File 'lib/fog/ovirt/models/compute/template.rb', line 29

def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
  connection.client.create_template(attributes)
end

#to_sObject



34
35
36
# File 'lib/fog/ovirt/models/compute/template.rb', line 34

def to_s
  name
end