Class: Toodledo::CommandLine::ListTasksByContextCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/toodledo/command_line/list_tasks_by_context_command.rb

Overview

List Tasks By Context

Instance Method Summary collapse

Methods inherited from BaseCommand

#client

Constructor Details

#initialize(client) ⇒ ListTasksByContextCommand

Returns a new instance of ListTasksByContextCommand.



8
9
10
11
12
# File 'lib/toodledo/command_line/list_tasks_by_context_command.rb', line 8

def initialize(client)
  super(client, 'nested', false)
  self.short_desc = "List tasks by context"
  self.description = "Lists the tasks grouped by context."
end

Instance Method Details

#execute(args) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/toodledo/command_line/list_tasks_by_context_command.rb', line 14

def execute(args)
  
  Toodledo.begin(client.logger) do |session|            
    line = args.join(' ')
    return client.list_tasks_by_context(session, line)
  end
  
  return 0
end