Represents an EC2 tag. @attr [String] value The tag value.
@return [String] The name of this tag.
@return [String] The name of this tag.
@return [Object] The EC2 resource this tag belongs to.
@param [String] key The name of the tag @param [Hash] options @option options [String] :value (”) The optional value of the tag.
# File lib/aws/ec2/tag.rb, line 24 def initialize resource, key, options = {} @resource = resource @key = key.to_s super end
Deletes this tag. @return [nil]
# File lib/aws/ec2/tag.rb, line 46 def delete(value = nil) tag_opts = { :key => key } tag_opts[:value] = value if value client.delete_tags(:resources => [resource.id], :tags => [tag_opts]) nil end
@private
# File lib/aws/ec2/tag.rb, line 54 def inspect "<#{self.class}:#{local_cache_key}>" end
@private
# File lib/aws/ec2/tag.rb, line 59 def local_cache_key response_index_key end
# File lib/aws/ec2/tag.rb, line 71 def get_resource attr client.describe_tags(:filters => [ { :name => "key", :values => [key] }, { :name => "resource-type", :values => [resource.tagging_resource_type] }, { :name => "resource-id", :values => [resource.send(:__resource_id__)] } ]) end