Class: Trackington::Task
- Inherits:
-
Object
- Object
- Trackington::Task
- Defined in:
- lib/trackington/app/tasks.rb
Constant Summary collapse
- STATUSES =
%w(open in_progress resolved closed reopened)- PRIORITIES =
%w(blocker critical major minor trivial)- TYPES =
%w(bug improvement new_feature story task)
Instance Attribute Summary collapse
-
#assigned_to ⇒ Object
readonly
Returns the value of attribute assigned_to.
-
#created_by ⇒ Object
readonly
Returns the value of attribute created_by.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#task_type ⇒ Object
readonly
Returns the value of attribute task_type.
-
#time_actual ⇒ Object
readonly
Returns the value of attribute time_actual.
-
#time_planned ⇒ Object
readonly
Returns the value of attribute time_planned.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(db_task) ⇒ Task
constructor
A new instance of Task.
- #update(data) ⇒ Object
Constructor Details
#initialize(db_task) ⇒ Task
Returns a new instance of Task.
66 67 68 69 70 |
# File 'lib/trackington/app/tasks.rb', line 66 def initialize(db_task) basic_properties(db_task) status_properties(db_task) person_properties(db_task) end |
Instance Attribute Details
#assigned_to ⇒ Object (readonly)
Returns the value of attribute assigned_to.
64 65 66 |
# File 'lib/trackington/app/tasks.rb', line 64 def assigned_to @assigned_to end |
#created_by ⇒ Object (readonly)
Returns the value of attribute created_by.
64 65 66 |
# File 'lib/trackington/app/tasks.rb', line 64 def created_by @created_by end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
63 64 65 |
# File 'lib/trackington/app/tasks.rb', line 63 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
63 64 65 |
# File 'lib/trackington/app/tasks.rb', line 63 def id @id end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
64 65 66 |
# File 'lib/trackington/app/tasks.rb', line 64 def priority @priority end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
64 65 66 |
# File 'lib/trackington/app/tasks.rb', line 64 def status @status end |
#task_type ⇒ Object (readonly)
Returns the value of attribute task_type.
64 65 66 |
# File 'lib/trackington/app/tasks.rb', line 64 def task_type @task_type end |
#time_actual ⇒ Object (readonly)
Returns the value of attribute time_actual.
63 64 65 |
# File 'lib/trackington/app/tasks.rb', line 63 def time_actual @time_actual end |
#time_planned ⇒ Object (readonly)
Returns the value of attribute time_planned.
63 64 65 |
# File 'lib/trackington/app/tasks.rb', line 63 def time_planned @time_planned end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
63 64 65 |
# File 'lib/trackington/app/tasks.rb', line 63 def title @title end |
Instance Method Details
#active? ⇒ Boolean
72 73 74 |
# File 'lib/trackington/app/tasks.rb', line 72 def active? %w(in_progress reopened open).include? @status end |
#update(data) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/trackington/app/tasks.rb', line 76 def update(data) db_task = Models::Task.find(@id) data.each do |property, new_value| db_task[property] = get_value(property, new_value) if property != :id end db_task.save basic_properties(db_task) status_properties(db_task) person_properties(db_task) end |