Class: Toodledo::CommandLine::ListTasksCommand

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

Overview

Lists the tasks.

Instance Method Summary collapse

Methods inherited from BaseCommand

#client

Constructor Details

#initialize(client) ⇒ ListTasksCommand

Returns a new instance of ListTasksCommand.



9
10
11
12
13
# File 'lib/toodledo/command_line/list_tasks_command.rb', line 9

def initialize(client)
  super(client, 'tasks', false)
  self.short_desc = "List tasks"
  self.description = "Lists the tasks in Toodledo."
end

Instance Method Details

#execute(args) ⇒ Object



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

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