Class AutomateIt::AccountManager::Etc::UserQuery
In: lib/automateit/account_manager/etc.rb
Parent: Object

UserQuery

A class used for querying users. See AccountManager#users.

Methods

[]  

Public Instance methods

See AccountManager#users

[Source]

# File lib/automateit/account_manager/etc.rb, line 28
    def [](query)
      ::Etc.endpwent
      begin
        case query
        when String
          return ::Etc.getpwnam(query)
        when Fixnum
          return ::Etc.getpwuid(query)
        else
          raise TypeError.new("unknonwn type for query: #{query.class}")
        end
      rescue ArgumentError
        return nil
      end
    end

[Validate]