Class: Toodledo::CommandLine::ListFoldersCommand

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

Overview

List Folders

Instance Method Summary collapse

Methods inherited from BaseCommand

#client

Constructor Details

#initialize(client) ⇒ ListFoldersCommand

Returns a new instance of ListFoldersCommand.



14
15
16
17
18
# File 'lib/toodledo/command_line/list_folders_command.rb', line 14

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

Instance Method Details

#execute(args) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/toodledo/command_line/list_folders_command.rb', line 20

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