Class: Inforouter::Users
- Inherits:
-
Object
- Object
- Inforouter::Users
- Defined in:
- lib/inforouter/users.rb
Class Method Summary collapse
-
.[](user_name) ⇒ Inforouter::User
Lookup a user by user name.
-
.all ⇒ Hash
All users.
Class Method Details
.[](user_name) ⇒ Inforouter::User
Lookup a user by user name.
20 21 22 |
# File 'lib/inforouter/users.rb', line 20 def [](user_name) all[user_name] end |
.all ⇒ Hash
All users.
7 8 9 10 11 12 13 |
# File 'lib/inforouter/users.rb', line 7 def all @users ||= begin response = Inforouter.client.request :get_all_users users = Inforouter::Responses::Users.parse response Hash[users.map { |user| [user.user_name, user] }] end end |