Sha256: 161c86edc50b9ce71943bc6a4b614e03f109f3fb6694a951b7993c146a9ab63b

Contents?: true

Size: 775 Bytes

Versions: 69

Compression:

Stored size: 775 Bytes

Contents

require 'fog/core/collection'
require 'fog/openstack/models/identity/user'

module Fog
  module Identity
    class OpenStack
      class Users < Fog::Collection
        model Fog::Identity::OpenStack::User

        attribute :tenant_id

        def all
          load(service.list_users(tenant_id).body['users'])
        end

        def find_by_id(id)
          self.find {|user| user.id == id} ||
            Fog::Identity::OpenStack::User.new(
              service.get_user_by_id(id).body['user'].merge(
                'service' => service
              )
            )
        end

        def destroy(id)
          user = self.find_by_id(id)
          user.destroy
        end
      end # class Users
    end # class OpenStack
  end # module Identity
end # module Fog

Version data entries

69 entries across 69 versions & 7 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/openstack/models/identity/users.rb
cifrado-0.2.1 vendor/fog/lib/fog/openstack/models/identity/users.rb
cifrado-0.2.0 vendor/fog/lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/openstack/models/identity/users.rb
fog-1.20.0 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/openstack/models/identity/users.rb
fog-1.19.0 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/openstack/models/identity/users.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/openstack/models/identity/users.rb