Class: AWS::Glacier::VaultCollection
- Inherits:
-
Object
- Object
- AWS::Glacier::VaultCollection
- Includes:
- Core::Collection::WithLimitAndNextToken
- Defined in:
- lib/aws/glacier/vault_collection.rb
Instance Attribute Summary collapse
- #account_id ⇒ String readonly
Instance Method Summary collapse
-
#[](name) ⇒ Vault
Returns a vault with the given name.
- #create(name) ⇒ Object
-
#initialize(options = {}) ⇒ VaultCollection
constructor
A new instance of VaultCollection.
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Constructor Details
#initialize(options = {}) ⇒ VaultCollection
Returns a new instance of VaultCollection.
23 24 25 26 |
# File 'lib/aws/glacier/vault_collection.rb', line 23 def initialize = {} @account_id = [:account_id] || '-' super end |
Instance Attribute Details
#account_id ⇒ String (readonly)
29 30 31 |
# File 'lib/aws/glacier/vault_collection.rb', line 29 def account_id @account_id end |
Instance Method Details
#[](name) ⇒ Vault
Returns a vault with the given name.
45 46 47 |
# File 'lib/aws/glacier/vault_collection.rb', line 45 def [] name Vault.new(name, :config => config, :account_id => account_id) end |
#create(name) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/aws/glacier/vault_collection.rb', line 32 def create name = {} [:vault_name] = name [:account_id] = account_id client.create_vault() self[name] end |