class AWS::Glacier::VaultCollection

Attributes

account_id[R]

@return [String]

Public Class Methods

new(options = {}) click to toggle source

@param [Hash] options @option options [String] :account_id

Calls superclass method
# File lib/aws/glacier/vault_collection.rb, line 23
def initialize options = {}
  @account_id = options[:account_id] || '-'
  super
end

Public Instance Methods

[](name) click to toggle source

@param [String] name The name of the vault. @return [Vault] Returns a vault with the given name.

# File lib/aws/glacier/vault_collection.rb, line 45
def [] name
  Vault.new(name, :config => config, :account_id => account_id)
end
create(name) click to toggle source

@param [String] name

# File lib/aws/glacier/vault_collection.rb, line 32
def create name

  options = {}
  options[:vault_name] = name
  options[:account_id] = account_id
  client.create_vault(options)

  self[name]

end

Protected Instance Methods

_each_item(next_token, limit, options) { |vault| ... } click to toggle source
# File lib/aws/glacier/vault_collection.rb, line 51
def _each_item next_token, limit, options, &block

  options[:limit] = limit if limit
  options[:marker] = next_token if next_token
  options[:account_id] = account_id

  resp = client.list_vaults(options)
  resp[:vault_list].each do |v|

    vault = Vault.new_from(:list_vaults, v,
      v[:vault_name],
      :config => config,
      :account_id => account_id)

    yield(vault)

  end

  resp[:marker]

end