You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Module: AWS::IAM::Collection::WithPrefix

Includes:
AWS::IAM::Collection
Included in:
GroupCollection, ServerCertificateCollection, UserCollection
Defined in:
lib/aws/iam/collection.rb

Overview

Common methods for collection classes that can be filtered by a path prefix.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Instance Attribute Details

#prefixString (readonly)

Returns The path prefix by which the collection is filtered.

Returns:

  • (String)

    The path prefix by which the collection is filtered.



27
28
29
# File 'lib/aws/iam/collection.rb', line 27

def prefix
  @prefix
end

Instance Method Details

#with_prefix(prefix) ⇒ GroupCollection

Returns a collection object including only those groups whose paths begin with the supplied prefix.

Parameters:

  • prefix (String)

    The path prefix for filtering the results.

Returns:



42
43
44
45
# File 'lib/aws/iam/collection.rb', line 42

def with_prefix prefix
  prefix = "/#{prefix}".sub(%r{^//}, "/")
  self.class.new(:prefix => prefix, :config => config)
end