module AWS::IAM::Collection::WithPrefix

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

Attributes

prefix[R]

@return [String] The path prefix by which the collection is

filtered.

Public Class Methods

new(options = {}) click to toggle source

@private

# File lib/aws/iam/collection.rb, line 30
def initialize options = {}
  @prefix = options[:prefix]
  super
end

Public Instance Methods

with_prefix(prefix) click to toggle source

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

@param [String] prefix The path prefix for filtering the

results.

@return [GroupCollection]

# File lib/aws/iam/collection.rb, line 42
def with_prefix prefix
  prefix = "/#{prefix}".sub(%r{^//}, "/")
  self.class.new(:prefix => prefix, :config => config)
end

Protected Instance Methods

_each_item(marker, max_items, options = {}) click to toggle source
# File lib/aws/iam/collection.rb, line 48
def _each_item marker, max_items, options = {}, &block
    
  prefix = options.delete(:prefix) || self.prefix

  options[:path_prefix] = "/#{prefix}".sub(%r{^//}, "/") if prefix

  super(marker, max_items, options, &block)

end