Class: QuickBase::Objects::User
- Inherits:
-
Object
- Object
- QuickBase::Objects::User
- Defined in:
- lib/QuickBaseObjects.rb
Overview
A User with access to an Application.
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#externalAuth ⇒ Object
readonly
Returns the value of attribute externalAuth.
-
#firstname ⇒ Object
readonly
Returns the value of attribute firstname.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#lastname ⇒ Object
readonly
Returns the value of attribute lastname.
-
#login ⇒ Object
readonly
Returns the value of attribute login.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
-
#screenName ⇒ Object
readonly
Returns the value of attribute screenName.
Instance Method Summary collapse
- #addInfo(qbc, email) ⇒ Object
- #build(user_role_xml, qbc) ⇒ Object
- #changeRole(role, new_role) ⇒ Object
- #set_qbc(qbc) ⇒ Object
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def email @email end |
#externalAuth ⇒ Object (readonly)
Returns the value of attribute externalAuth.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def externalAuth @externalAuth end |
#firstname ⇒ Object (readonly)
Returns the value of attribute firstname.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def firstname @firstname end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def id @id end |
#lastname ⇒ Object (readonly)
Returns the value of attribute lastname.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def lastname @lastname end |
#login ⇒ Object (readonly)
Returns the value of attribute login.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def login @login end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def name @name end |
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
369 370 371 |
# File 'lib/QuickBaseObjects.rb', line 369 def roles @roles end |
#screenName ⇒ Object (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.login @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 |