Class: SysAid::User
- Inherits:
-
Object
- Object
- SysAid::User
- Defined in:
- lib/sysaid/user.rb
Instance Attribute Summary collapse
-
#admin ⇒ Object
Returns the value of attribute admin.
-
#agreement ⇒ Object
Returns the value of attribute agreement.
-
#building ⇒ Object
Returns the value of attribute building.
-
#car_number ⇒ Object
Returns the value of attribute car_number.
-
#cellphone ⇒ Object
Returns the value of attribute cellphone.
-
#company ⇒ Object
Returns the value of attribute company.
-
#cubic ⇒ Object
Returns the value of attribute cubic.
-
#cust_int1 ⇒ Object
Returns the value of attribute cust_int1.
-
#cust_int2 ⇒ Object
Returns the value of attribute cust_int2.
-
#cust_list1 ⇒ Object
Returns the value of attribute cust_list1.
-
#cust_list2 ⇒ Object
Returns the value of attribute cust_list2.
-
#cust_notes ⇒ Object
Returns the value of attribute cust_notes.
-
#cust_text1 ⇒ Object
Returns the value of attribute cust_text1.
-
#cust_text2 ⇒ Object
Returns the value of attribute cust_text2.
-
#department ⇒ Object
Returns the value of attribute department.
-
#disable ⇒ Object
Returns the value of attribute disable.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#email ⇒ Object
Returns the value of attribute email.
-
#email_notifications ⇒ Object
Returns the value of attribute email_notifications.
-
#enable_login_to_eup ⇒ Object
Returns the value of attribute enable_login_to_eup.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#floor ⇒ Object
Returns the value of attribute floor.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#location ⇒ Object
Returns the value of attribute location.
-
#login_domain ⇒ Object
Returns the value of attribute login_domain.
-
#login_user ⇒ Object
Returns the value of attribute login_user.
-
#manager ⇒ Object
Returns the value of attribute manager.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#secondary_email ⇒ Object
Returns the value of attribute secondary_email.
-
#sms ⇒ Object
Returns the value of attribute sms.
-
#user_manager_name ⇒ Object
Returns the value of attribute user_manager_name.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes a user from the SysAid server.
-
#initialize(username = nil) ⇒ User
constructor
Creates a SysAid::User object.
-
#refresh ⇒ Object
Loads the latest user information from the SysAid server.
-
#save ⇒ Object
Saves a user back to the SysAid server.
Constructor Details
#initialize(username = nil) ⇒ User
Creates a SysAid::User object
Example:
>> SysAid::User.new
=> SysAid::User
Arguments:
username: (SysAid username, optional)
15 16 17 |
# File 'lib/sysaid/user.rb', line 15 def initialize(username = nil) self.username = username end |
Instance Attribute Details
#admin ⇒ Object
Returns the value of attribute admin.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def admin @admin end |
#agreement ⇒ Object
Returns the value of attribute agreement.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def agreement @agreement end |
#building ⇒ Object
Returns the value of attribute building.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def building @building end |
#car_number ⇒ Object
Returns the value of attribute car_number.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def car_number @car_number end |
#cellphone ⇒ Object
Returns the value of attribute cellphone.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cellphone @cellphone end |
#company ⇒ Object
Returns the value of attribute company.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def company @company end |
#cubic ⇒ Object
Returns the value of attribute cubic.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cubic @cubic end |
#cust_int1 ⇒ Object
Returns the value of attribute cust_int1.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cust_int1 @cust_int1 end |
#cust_int2 ⇒ Object
Returns the value of attribute cust_int2.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cust_int2 @cust_int2 end |
#cust_list1 ⇒ Object
Returns the value of attribute cust_list1.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cust_list1 @cust_list1 end |
#cust_list2 ⇒ Object
Returns the value of attribute cust_list2.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cust_list2 @cust_list2 end |
#cust_notes ⇒ Object
Returns the value of attribute cust_notes.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cust_notes @cust_notes end |
#cust_text1 ⇒ Object
Returns the value of attribute cust_text1.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cust_text1 @cust_text1 end |
#cust_text2 ⇒ Object
Returns the value of attribute cust_text2.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def cust_text2 @cust_text2 end |
#department ⇒ Object
Returns the value of attribute department.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def department @department end |
#disable ⇒ Object
Returns the value of attribute disable.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def disable @disable end |
#display_name ⇒ Object
Returns the value of attribute display_name.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def display_name @display_name end |
#email ⇒ Object
Returns the value of attribute email.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def email @email end |
#email_notifications ⇒ Object
Returns the value of attribute email_notifications.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def email_notifications @email_notifications end |
#enable_login_to_eup ⇒ Object
Returns the value of attribute enable_login_to_eup.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def enable_login_to_eup @enable_login_to_eup end |
#first_name ⇒ Object
Returns the value of attribute first_name.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def first_name @first_name end |
#floor ⇒ Object
Returns the value of attribute floor.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def floor @floor end |
#last_name ⇒ Object
Returns the value of attribute last_name.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def last_name @last_name end |
#location ⇒ Object
Returns the value of attribute location.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def location @location end |
#login_domain ⇒ Object
Returns the value of attribute login_domain.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def login_domain @login_domain end |
#login_user ⇒ Object
Returns the value of attribute login_user.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def login_user @login_user end |
#manager ⇒ Object
Returns the value of attribute manager.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def manager @manager end |
#notes ⇒ Object
Returns the value of attribute notes.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def notes @notes end |
#phone ⇒ Object
Returns the value of attribute phone.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def phone @phone end |
#secondary_email ⇒ Object
Returns the value of attribute secondary_email.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def secondary_email @secondary_email end |
#sms ⇒ Object
Returns the value of attribute sms.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def sms @sms end |
#user_manager_name ⇒ Object
Returns the value of attribute user_manager_name.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def user_manager_name @user_manager_name end |
#username ⇒ Object
Returns the value of attribute username.
2 3 4 |
# File 'lib/sysaid/user.rb', line 2 def username @username end |
Class Method Details
Instance Method Details
#delete ⇒ Object
Deletes a user from the SysAid server
Example:
>> user_object.delete
=> nil
62 63 64 65 66 |
# File 'lib/sysaid/user.rb', line 62 def delete SysAid.ensure_logged_in SysAid.call(:delete, message: to_xml(false).to_s ) end |
#refresh ⇒ Object
Loads the latest user information from the SysAid server
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sysaid/user.rb', line 28 def refresh SysAid.ensure_logged_in response = SysAid.call(:load_by_string_id, message: to_xml.to_s ) if response.to_hash[:load_by_string_id_response][:return] set_self_from_response(response.to_hash[:load_by_string_id_response][:return]) return true end return false end |
#save ⇒ Object
Saves a user back to the SysAid server
Example:
>> user_object.save
=> true
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/sysaid/user.rb', line 45 def save SysAid.ensure_logged_in # Save it via the SOAP API response = SysAid.call(:save, message: to_xml(false).to_s ) if response.to_hash[:save_response][:return] return true else return false end end |