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
-
#prefix ⇒ String
readonly
The path prefix by which the collection is filtered.
Attributes included from Core::Model
Instance Method Summary collapse
- #initialize(options = {}) ⇒ Object
-
#with_prefix(prefix) ⇒ GroupCollection
Returns a collection object including only those groups whose paths begin with the supplied prefix.
Methods included from Core::Collection::Limitable
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Methods included from Core::Model
#client, #config_prefix, #inspect
Instance Attribute Details
#prefix ⇒ String (readonly)
Returns 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
#initialize(options = {}) ⇒ Object
30 31 32 33 |
# File 'lib/aws/iam/collection.rb', line 30 def initialize = {} @prefix = [:prefix] super end |
#with_prefix(prefix) ⇒ GroupCollection
Returns a collection object including only those groups whose paths begin with the supplied prefix.
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 |