Sha256: 35619dea99b65b03fccf496c7c583aef41a5e2b98ef5d366f0ffe45aa2bd23fe

Contents?: true

Size: 809 Bytes

Versions: 48

Compression:

Stored size: 809 Bytes

Contents

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

module Fog
  module Rackspace
    class Identity
      class Users < Fog::Collection

        model Fog::Rackspace::Identity::User

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

        def get(user_id)
          data = service.get_user_by_id(user_id).body['user']
          new(data)
        rescue Excon::Errors::NotFound
          nil
        rescue Excon::Errors::Unauthorized
          nil
        end

        def get_by_name(user_name)
          data = service.get_user_by_name(user_name).body['user']
          new(data)
        rescue Excon::Errors::NotFound
          nil
        rescue Excon::Errors::Unauthorized
          nil
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
fog-maestrodev-1.18.0.20131209090811 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/rackspace/models/identity/users.rb
gapinc-fog-1.12.1.2.1 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/rackspace/models/identity/users.rb
fog-1.18.0 lib/fog/rackspace/models/identity/users.rb
fog-1.17.0 lib/fog/rackspace/models/identity/users.rb
fog-1.16.0 lib/fog/rackspace/models/identity/users.rb