Class: SysAid::Task
- Inherits:
-
Object
- Object
- SysAid::Task
- Defined in:
- lib/sysaid/task.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#ciid ⇒ Object
Returns the value of attribute ciid.
-
#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.
-
#estimation ⇒ Object
Returns the value of attribute estimation.
-
#id ⇒ Object
Returns the value of attribute id.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#progress ⇒ Object
Returns the value of attribute progress.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#status ⇒ Object
Returns the value of attribute status.
-
#task_dependency ⇒ Object
Returns the value of attribute task_dependency.
-
#task_dependency_type ⇒ Object
Returns the value of attribute task_dependency_type.
-
#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 task from the SysAid server.
-
#initialize ⇒ Task
constructor
A new instance of Task.
-
#refresh ⇒ Object
Loads the latest task information from the SysAid server.
-
#save ⇒ Object
Saves a task back to the SysAid server.
Constructor Details
#initialize ⇒ Task
Returns a new instance of Task.
9 10 11 12 |
# File 'lib/sysaid/task.rb', line 9 def initialize self.start_time = Date.new self.end_time = Date.new end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def category @category end |
#ciid ⇒ Object
Returns the value of attribute ciid.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def ciid @ciid end |
#cust_date1 ⇒ Object
Returns the value of attribute cust_date1.
4 5 6 |
# File 'lib/sysaid/task.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/task.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/task.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/task.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/task.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/task.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/task.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/task.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/task.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/task.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/task.rb', line 4 def custom_fields @custom_fields end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def description @description end |
#end_time ⇒ Object
Returns the value of attribute end_time.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def end_time @end_time end |
#estimation ⇒ Object
Returns the value of attribute estimation.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def estimation @estimation end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def id @id end |
#notes ⇒ Object
Returns the value of attribute notes.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def notes @notes end |
#progress ⇒ Object
Returns the value of attribute progress.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def progress @progress end |
#project_id ⇒ Object
Returns the value of attribute project_id.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def project_id @project_id end |
#start_time ⇒ Object
Returns the value of attribute start_time.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def start_time @start_time end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def status @status end |
#task_dependency ⇒ Object
Returns the value of attribute task_dependency.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def task_dependency @task_dependency end |
#task_dependency_type ⇒ Object
Returns the value of attribute task_dependency_type.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def task_dependency_type @task_dependency_type end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def title @title end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/sysaid/task.rb', line 4 def version @version end |
Class Method Details
.find_by_id(task_id) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/sysaid/task.rb', line 14 def self.find_by_id(task_id) task = SysAid::Task.new task.id = task_id return nil unless task.refresh return task end |
.find_by_project_id(project_id) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sysaid/task.rb', line 24 def self.find_by_project_id(project_id) SysAid.ensure_logged_in response = SysAid.call(:execute_select_query, message: sql_query(project_id)) 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 task from the SysAid server
No return value as SysAid’s ‘delete’ call returns void. No idea why.
Example:
>> task_object.delete
=> true
74 75 76 77 78 |
# File 'lib/sysaid/task.rb', line 74 def delete SysAid.ensure_logged_in SysAid.call(:delete, message: to_xml(false)) end |
#refresh ⇒ Object
Loads the latest task information from the SysAid server
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/sysaid/task.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 task back to the SysAid server
Example:
>> task_object.save
=> true
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/sysaid/task.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 |