class Fog::AWS::IAM::Users

Public Instance Methods

all(options = {}) click to toggle source
# File lib/fog/aws/models/iam/users.rb, line 12
def all(options = {})
  merge_attributes(options)
  data = service.list_users(options).body
  merge_attributes('IsTruncated' => data['IsTruncated'], 'Marker' => data['Marker'])
  load(data['Users']) # data is an array of attribute hashes
end
current() click to toggle source
# File lib/fog/aws/models/iam/users.rb, line 19
def current
  new(service.get_user.body['User'])
end
each() { |f| ... } click to toggle source
# File lib/fog/aws/models/iam/users.rb, line 32
def each
  if !block_given?
    self
  else
    subset = dup.all

    subset.each_user_this_page {|f| yield f}
    while subset.is_truncated
      subset = subset.all('Marker' => subset.marker, 'MaxItems' => 1000)
      subset.each_user_this_page {|f| yield f}
    end

    self
  end
end
Also aliased as: each_user_this_page
each_user_this_page()
Alias for: each
get(identity) click to toggle source
# File lib/fog/aws/models/iam/users.rb, line 23
def get(identity)
  data = service.get_user(identity).body['User']
  new(data) # data is an attribute hash
rescue Fog::AWS::IAM::NotFound
  nil
end