Class: Fog::Compute::VcloudDirector::Tag

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #lazy_load_attrs, #make_attr_loaded_method, #make_lazy_load_method

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 Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Compute::VcloudDirector::Model

Instance Method Details

#destroyObject



22
23
24
25
# File 'lib/fog/vcloud_director/models/compute/tag.rb', line 22

def destroy
  response = service.(vm.id, id)
  service.process_task(response.body)
end

#value=(new_value) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/fog/vcloud_director/models/compute/tag.rb', line 12

def value=(new_value)
  has_changed = ( value != new_value )
  not_first_set = !value.nil?
  attributes[:value] = new_value
  if not_first_set && has_changed
    response = service.(vm.id, id, value)
    service.process_task(response.body)
  end
end

#vmObject



27
28
29
# File 'lib/fog/vcloud_director/models/compute/tag.rb', line 27

def vm
  attributes[:vm]
end