Class: Fog::AWS::Compute::Tag

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#inspect, #reload, #to_json, #wait_for

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

#initialize(attributes = {}) ⇒ Tag

Returns a new instance of Tag.



15
16
17
# File 'lib/fog/compute/models/aws/tag.rb', line 15

def initialize(attributes = {})
  super
end

Instance Method Details

#destroyObject



19
20
21
22
23
# File 'lib/fog/compute/models/aws/tag.rb', line 19

def destroy
  requires :key, :resource_id
  connection.delete_tags(resource_id, key)
  true
end

#saveObject



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

def save
  requires :key, :resource_id
  connection.create_tags(resource_id, key => value)
  true
end