Class: ConsoleRtm::Task
- Inherits:
-
Object
- Object
- ConsoleRtm::Task
- Defined in:
- lib/rmilk/task.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#list_name ⇒ Object
readonly
Returns the value of attribute list_name.
-
#milk_task ⇒ Object
Returns the value of attribute milk_task.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #==(obj) ⇒ Object
- #complete! ⇒ Object
- #delete! ⇒ Object
- #due=(due) ⇒ Object
-
#initialize(id, text, list_name, milk_task = nil, tags = {}) ⇒ Task
constructor
A new instance of Task.
- #move_to(to_list_id) ⇒ Object
- #postpone! ⇒ Object
- #priority ⇒ Object
- #priority=(priority) ⇒ Object
- #to_s ⇒ Object
- #uncomplete! ⇒ Object
Constructor Details
#initialize(id, text, list_name, milk_task = nil, tags = {}) ⇒ Task
Returns a new instance of Task.
9 10 11 12 13 14 15 |
# File 'lib/rmilk/task.rb', line 9 def initialize(id, text, list_name, milk_task = nil, = {}) @id = id @text = text @list_name = list_name @milk_task = milk_task = end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/rmilk/task.rb', line 6 def id @id end |
#list_name ⇒ Object (readonly)
Returns the value of attribute list_name.
6 7 8 |
# File 'lib/rmilk/task.rb', line 6 def list_name @list_name end |
#milk_task ⇒ Object
Returns the value of attribute milk_task.
7 8 9 |
# File 'lib/rmilk/task.rb', line 7 def milk_task @milk_task end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
6 7 8 |
# File 'lib/rmilk/task.rb', line 6 def end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/rmilk/task.rb', line 6 def text @text end |
Instance Method Details
#==(obj) ⇒ Object
55 56 57 58 |
# File 'lib/rmilk/task.rb', line 55 def ==(obj) id = obj.id && text == obj.text && list_name == obj.list_name && == obj. end |
#complete! ⇒ Object
17 18 19 |
# File 'lib/rmilk/task.rb', line 17 def complete! @milk_task.complete! end |
#delete! ⇒ Object
21 22 23 |
# File 'lib/rmilk/task.rb', line 21 def delete! @milk_task.delete! end |
#due=(due) ⇒ Object
41 42 43 |
# File 'lib/rmilk/task.rb', line 41 def due=(due) execute_milk "rtm.tasks.setDueDate", {:due => due} end |
#move_to(to_list_id) ⇒ Object
45 46 47 48 49 |
# File 'lib/rmilk/task.rb', line 45 def move_to(to_list_id) execute_milk "rtm.tasks.moveTo", {:from_list_id => milk_task.list_id, :to_list_id => to_list_id} end |
#postpone! ⇒ Object
25 26 27 |
# File 'lib/rmilk/task.rb', line 25 def postpone! execute_milk "rtm.tasks.postpone" end |
#priority ⇒ Object
37 38 39 |
# File 'lib/rmilk/task.rb', line 37 def priority milk_task.priority end |
#priority=(priority) ⇒ Object
33 34 35 |
# File 'lib/rmilk/task.rb', line 33 def priority=(priority) execute_milk "rtm.tasks.setPriority", {:priority => priority} end |
#to_s ⇒ Object
51 52 53 |
# File 'lib/rmilk/task.rb', line 51 def to_s "#{@list_name}: #{@id} - #{@text}" end |
#uncomplete! ⇒ Object
29 30 31 |
# File 'lib/rmilk/task.rb', line 29 def uncomplete! execute_milk "rtm.tasks.uncomplete" end |