Class: Toodledo::CommandLine::ListContextsCommand
- Inherits:
-
BaseCommand
- Object
- CmdParse::Command
- BaseCommand
- Toodledo::CommandLine::ListContextsCommand
- Defined in:
- lib/toodledo/command_line/list_contexts_command.rb
Overview
List Contexts
Instance Method Summary collapse
- #execute(args) ⇒ Object
-
#initialize(client) ⇒ ListContextsCommand
constructor
A new instance of ListContextsCommand.
Methods inherited from BaseCommand
Constructor Details
#initialize(client) ⇒ ListContextsCommand
Returns a new instance of ListContextsCommand.
13 14 15 16 17 |
# File 'lib/toodledo/command_line/list_contexts_command.rb', line 13 def initialize(client) super(client, 'contexts', false) self.short_desc = "List contexts" self.description = "Lists the contexts in Toodledo." end |
Instance Method Details
#execute(args) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/toodledo/command_line/list_contexts_command.rb', line 19 def execute(args) Toodledo.begin(client.logger) do |session| line = args.join(' ') return client.list_contexts(session, line) end return 0 end |