Sha256: c025617400d33001381419c117d7af7d561dd2b52abbd23a522c982624ae067d

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

require 'fog/core/collection'
require 'fog/aws/models/iam/user'

module Fog
  module AWS
    class IAM

      class Users < Fog::Collection

        model Fog::AWS::IAM::User

        def all
          data = connection.list_users.body['Users']
          load(data) # data is an array of attribute hashes
        end

        def get(identity)
          data = connection.get_user(identity).body['User']
          new(data) # data is an attribute hash
        rescue Fog::AWS::IAM::NotFound
          nil
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-1.4.0 lib/fog/aws/models/iam/users.rb