Class: AutomateIt::AccountManager::Etc::UserQuery
- Defined in:
- lib/automateit/account_manager/etc.rb
Overview
UserQuery
A class used for querying users. See AccountManager#users.
Instance Method Summary collapse
-
#[](query) ⇒ Object
See AccountManager#users.
Instance Method Details
#[](query) ⇒ Object
See AccountManager#users
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# 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 |