Class: Keystone::V2_0::Manager::User

Inherits:
Base
  • Object
show all
Defined in:
lib/keystone/v2_0/manager/user.rb

Constant Summary collapse

@@url_endpoint =
"users"

Instance Attribute Summary

Attributes inherited from Base

#auth_url, #token, #url_endpoint

Instance Method Summary collapse

Constructor Details

#initialize(auth_url) ⇒ User

Returns a new instance of User.



10
11
12
# File 'lib/keystone/v2_0/manager/user.rb', line 10

def initialize(auth_url)
  super auth_url, @@url_endpoint
end

Instance Method Details

#listObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/keystone/v2_0/manager/user.rb', line 14

def list
  users     = super
  user_list = []

  # map user hash to array of User objects
  unless users.nil?
    users["users"].each do |user_data|
      user_resource = Keystone::V2_0::Resource::User.new(user_data)
      user_list << user_resource
    end

    return user_list
  else
    return nil
  end
end