Class AWS::S3::BucketTagCollection
In: lib/aws/s3/bucket_tag_collection.rb
Parent: Object

Manages tags for a single S3 {Bucket}.

@example Setting a tag.

  bucket.tags['key'] = 'value'

@example Getting a tag.

  bucket.tags['key']
  #=> 'value'

@example Getting all tags

  bucket.tags.to_h
  #=> { 'key' => 'value', ... }

@example Removing all tags

  bucket.tags.clear

Methods

==   []   []=   clear   eql?   inspect   new   set   to_h   to_hash  

Included Modules

Core::Model

Attributes

bucket  [R]  @return [Bucket]

Public Class methods

@param [Bucket] bucket @param [Hash] options

Public Instance methods

==(other)

Alias for eql?

@param [String] key @return [String,nil] Returns the tag for the given key. If there

   Returns `nil` if the key does not exist.

@param [String] key @param [String] value

Removes all tags from the bucket.

@example

  bucket.tags.clear
  bucket.tags.to_h #=> {}

@return [nil]

@param [Hash] other @return [Boolean] Returns `true` if the tags for this bucket match

  the passed hash.

@api private

@param [Hash<String,String>] tags A hash of tag keys and values. @return [nil]

@return [Hash]

to_hash()

Alias for to_h

[Validate]