Module: Tapjoy::LDAP::API::User

Extended by:
Memoist
Defined in:
lib/tapjoy/ldap/api/user.rb

Class Method Summary collapse

Class Method Details

.create(fname, lname, type, group) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/tapjoy/ldap/api/user.rb', line 8

def create(fname, lname, type, group)
  # Properly capitalize names
  fname, lname = [fname, lname].map(&:capitalize)

  Tapjoy::LDAP.client.add(
    distinguished_name(fname, lname, type),
    ldap_attr(fname, lname, type, group)
  )
end

.destroy(username, type) ⇒ Object



18
19
20
21
22
# File 'lib/tapjoy/ldap/api/user.rb', line 18

def destroy(username, type)
  Tapjoy::LDAP.client.delete(
    distinguished_name(*name_of_user(username), type)
  )
end

.indexObject



24
25
26
# File 'lib/tapjoy/ldap/api/user.rb', line 24

def index
  Tapjoy::LDAP.client.search('*', filter(uid: '*'))
end

.show(username) ⇒ Object



28
29
30
# File 'lib/tapjoy/ldap/api/user.rb', line 28

def show(username)
  Tapjoy::LDAP.client.search('*', filter(uid: username))
end