Class: SysAid::Project
- Inherits:
-
Object
- Object
- SysAid::Project
- Defined in:
- lib/sysaid/project.rb
Instance Attribute Summary collapse
-
#assigned_group ⇒ Object
Returns the value of attribute assigned_group.
-
#category ⇒ Object
Returns the value of attribute category.
-
#company ⇒ Object
Returns the value of attribute company.
-
#cust_date1 ⇒ Object
Returns the value of attribute cust_date1.
-
#cust_date2 ⇒ Object
Returns the value of attribute cust_date2.
-
#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.
-
#custom_date_fields ⇒ Object
Returns the value of attribute custom_date_fields.
-
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
-
#description ⇒ Object
Returns the value of attribute description.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#id ⇒ Object
Returns the value of attribute id.
-
#incident_title ⇒ Object
Returns the value of attribute incident_title.
-
#manager ⇒ Object
Returns the value of attribute manager.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#progress ⇒ Object
Returns the value of attribute progress.
-
#raw_estimation ⇒ Object
Returns the value of attribute raw_estimation.
-
#request_group ⇒ Object
Returns the value of attribute request_group.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#status ⇒ Object
Returns the value of attribute status.
-
#title ⇒ Object
Returns the value of attribute title.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes a project from the SysAid server.
-
#initialize ⇒ Project
constructor
A new instance of Project.
-
#refresh ⇒ Object
Loads the latest project information from the SysAid server.
-
#save ⇒ Object
Saves a project back to the SysAid server.
Constructor Details
#initialize ⇒ Project
Returns a new instance of Project.
9 10 11 12 |
# File 'lib/sysaid/project.rb', line 9 def initialize self.start_time = Date.new self.end_time = Date.new end |
Instance Attribute Details
#assigned_group ⇒ Object
Returns the value of attribute assigned_group.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def assigned_group @assigned_group end |
#category ⇒ Object
Returns the value of attribute category.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def category @category end |
#company ⇒ Object
Returns the value of attribute company.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def company @company end |
#cust_date1 ⇒ Object
Returns the value of attribute cust_date1.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_date1 @cust_date1 end |
#cust_date2 ⇒ Object
Returns the value of attribute cust_date2.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_date2 @cust_date2 end |
#cust_int1 ⇒ Object
Returns the value of attribute cust_int1.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_int1 @cust_int1 end |
#cust_int2 ⇒ Object
Returns the value of attribute cust_int2.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_int2 @cust_int2 end |
#cust_list1 ⇒ Object
Returns the value of attribute cust_list1.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_list1 @cust_list1 end |
#cust_list2 ⇒ Object
Returns the value of attribute cust_list2.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_list2 @cust_list2 end |
#cust_notes ⇒ Object
Returns the value of attribute cust_notes.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_notes @cust_notes end |
#cust_text1 ⇒ Object
Returns the value of attribute cust_text1.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_text1 @cust_text1 end |
#cust_text2 ⇒ Object
Returns the value of attribute cust_text2.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def cust_text2 @cust_text2 end |
#custom_date_fields ⇒ Object
Returns the value of attribute custom_date_fields.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def custom_date_fields @custom_date_fields end |
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def custom_fields @custom_fields end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def description @description end |
#end_time ⇒ Object
Returns the value of attribute end_time.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def end_time @end_time end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def id @id end |
#incident_title ⇒ Object
Returns the value of attribute incident_title.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def incident_title @incident_title end |
#manager ⇒ Object
Returns the value of attribute manager.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def manager @manager end |
#notes ⇒ Object
Returns the value of attribute notes.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def notes @notes end |
#progress ⇒ Object
Returns the value of attribute progress.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def progress @progress end |
#raw_estimation ⇒ Object
Returns the value of attribute raw_estimation.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def raw_estimation @raw_estimation end |
#request_group ⇒ Object
Returns the value of attribute request_group.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def request_group @request_group end |
#start_time ⇒ Object
Returns the value of attribute start_time.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def start_time @start_time end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def status @status end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def title @title end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/sysaid/project.rb', line 4 def version @version end |
Class Method Details
.find_by_id(project_id) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/sysaid/project.rb', line 14 def self.find_by_id(project_id) project = SysAid::Project.new project.id = project_id return nil unless project.refresh return project end |
.find_by_query(query) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sysaid/project.rb', line 24 def self.find_by_query(query) SysAid.ensure_logged_in response = SysAid.call(:execute_select_query, message: sql_query(query)) if response.to_hash[:execute_select_query_response][:return] return response.to_hash[:execute_select_query_response][:return] end return false end |
Instance Method Details
#delete ⇒ Object
Deletes a project from the SysAid server
No return value as SysAid’s ‘delete’ call returns void. No idea why.
Example:
>> project_object.delete
=> true
74 75 76 77 |
# File 'lib/sysaid/project.rb', line 74 def delete SysAid.ensure_logged_in SysAid.call(:delete, message: to_xml(false)) end |
#refresh ⇒ Object
Loads the latest project information from the SysAid server
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/sysaid/project.rb', line 37 def refresh SysAid.ensure_logged_in response = SysAid.call(:load_by_string_id, message: to_xml) 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 project back to the SysAid server
Example:
>> project_object.save
=> true
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/sysaid/project.rb', line 55 def save SysAid.ensure_logged_in # Save it via the SOAP API response = SysAid.call(:save, message: to_xml(false)) if response.to_hash[:save_response][:return] return true else return false end end |