Module: Tasks
- Included in:
- Things
- Defined in:
- lib/harvestthings/things/tasks.rb
Instance Method Summary collapse
-
#task_complete?(id) ⇒ Boolean
task_complete? - boolean of whether the task is complete.
-
#task_description(id) ⇒ String
task_description - grab formatted version of a task’s description.
-
#tasks(id) ⇒ Array
tasks - grab an array of the various task ids from the xml.
Instance Method Details
#task_complete?(id) ⇒ Boolean
task_complete? - boolean of whether the task is complete
27 28 29 30 |
# File 'lib/harvestthings/things/tasks.rb', line 27 def task_complete?(id) task = @xml.search("object[@id='#{id}']") task.search("attribute[@name='datecompleted']").any? end |
#task_description(id) ⇒ String
task_description - grab formatted version of a task’s description
17 18 19 20 21 |
# File 'lib/harvestthings/things/tasks.rb', line 17 def task_description(id) task = @xml.search("object[@id='#{id}']") title = task.search("attribute[@name='title']") clean(title.innerHTML.to_s) end |
#tasks(id) ⇒ Array
tasks - grab an array of the various task ids from the xml
6 7 8 9 10 11 |
# File 'lib/harvestthings/things/tasks.rb', line 6 def tasks(id) project = @xml.search("object[@id='#{id}']") project.search("relationship[@name='children']") do |elem| return elem.attributes["idrefs"].to_s.split(" ") end end |