Class: QuickBase::Objects::User

Inherits:
Object
  • Object
show all
Defined in:
lib/QuickBaseObjects.rb

Overview

A User with access to an Application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def email
  @email
end

#externalAuthObject (readonly)

Returns the value of attribute externalAuth.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def externalAuth
  @externalAuth
end

#firstnameObject (readonly)

Returns the value of attribute firstname.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def firstname
  @firstname
end

#idObject (readonly)

Returns the value of attribute id.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def id
  @id
end

#lastnameObject (readonly)

Returns the value of attribute lastname.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def lastname
  @lastname
end

#loginObject (readonly)

Returns the value of attribute login.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def 
  @login
end

#nameObject (readonly)

Returns the value of attribute name.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def name
  @name
end

#rolesObject (readonly)

Returns the value of attribute roles.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def roles
  @roles
end

#screenNameObject (readonly)

Returns the value of attribute screenName.



369
370
371
# File 'lib/QuickBaseObjects.rb', line 369

def screenName
  @screenName
end

Instance Method Details

#addInfo(qbc, email) ⇒ Object



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/QuickBaseObjects.rb', line 387

def addInfo(qbc,email)
   set_qbc(qbc)
   @qbc.getUserInfo(email)
   @name = @qbc.name
   @firstName = @qbc.firstName
   @lastName = @qbc.lastName
   @login = @qbc.
   @email = @qbc.email
   @screenName = @qbc.screenName
   @externalAuth = @qbc.externalAuth
   @id = @qbc.userid
   @qbc.getUserRole(@dbid, @id)
   @roles ||= []
   @roles << @qbc.roleid.dup
end

#build(user_role_xml, qbc) ⇒ Object



374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/QuickBaseObjects.rb', line 374

def build(user_role_xml,qbc)
   raise "user_role_xml is not an XML element" if !user_role_xml.is_a?(REXML::Element)
   set_qbc(qbc)
   @id = user_role_xml.attributes["id"]
   @name = user_role_xml.elements["name"].text.dup
   @roles = []
   rolesProc = proc { |element|
      if element.is_a?(REXML::Element) and element.name == "role"
         roles << element.attributes["id"]
      end
   }
   qbc.processChildElements(user_role_xml,false,rolesProc)
end

#changeRole(role, new_role) ⇒ Object



402
403
404
405
406
# File 'lib/QuickBaseObjects.rb', line 402

def changeRole(role,new_role)
  raise "#{role} is not a Role object" if !is_a?(Role)
  raise "#{new_role} is not a Role object" if !is_a?(Role)
  @qbc.addUserToRole(@dbid,id,role.id,new_role.id)
end

#set_qbc(qbc) ⇒ Object



370
371
372
373
# File 'lib/QuickBaseObjects.rb', line 370

def set_qbc(qbc)
   @qbc = qbc
   @dbid = qbc.dbid.dup
end