app/thl_menu_bar.rb
# Return the list of incomplete tasks for today, to a maximum of 5.
#
# Rubymotion note: Uses #properties['completed'] instead of
# #completed because the ScriptingBridge defines methods as
# returning objects, and #completed returns a boolean directly.  I
# believe it would need to be specially precompiled to be correctly
# recognized.  (ibid for 'canceled'.)
Return the list of incomplete tasks for today, to a maximum of 5.
Rubymotion note: Uses #properties['completed'] instead of
completed because the ScriptingBridge defines methods as
returning objects, and #completed returns a boolean directly.  I
believe it would need to be specially precompiled to be correctly
recognized.  (ibid for 'canceled'.)
Return the list of incomplete tasks for today to a maximum of 5 . Rubymotion note : Uses #properties [ ' completed ' ] instead of completed because the ScriptingBridge defines methods as returning objects and #completed returns a boolean directly . I believe it would need to be specially precompiled to be correctly recognized . ( ibid for ' canceled ' . )
def tasks
    show_tasks = @hitlist.todayList.tasks.select {|task| !task.properties['completed'] && !task.properties['canceled']}.sort_by(&@sort_by)
    if show_tasks.length < @maximum_tasks
      inbox = @hitlist.inbox.tasks.select {|task| !task.properties['completed'] && !task.properties['canceled']}.sort_by(&@sort_by)
      show_tasks += inbox
    end
    show_tasks[0..@maximum_tasks]
  end
def tasks show_tasks = @hitlist . todayList . tasks . select { | task | ! task . properties [ 'completed' ] && ! task . properties [ 'canceled' ] } . sort_by ( & @sort_by ) if show_tasks . length < @maximum_tasks inbox = @hitlist . inbox . tasks . select { | task | ! task . properties [ 'completed' ] && ! task . properties [ 'canceled' ] } . sort_by ( & @sort_by ) show_tasks += inbox end show_tasks [ 0 .. @maximum_tasks ] end
Return the list of incomplete tasks for today, to a maximum of 5.
Return the list of incomplete tasks for today to a maximum of 5 .