Class: Todos::Commands::GeneralCommands::ListContexts

Inherits:
Object
  • Object
show all
Extended by:
BasicList
Defined in:
lib/todos_cli.rb

Constant Summary collapse

KEY =
'c'
DESCRIPTION =
'List contexts'

Class Method Summary collapse

Methods included from BasicList

print_list

Class Method Details

.executeObject



128
129
130
131
132
133
134
135
136
137
138
# File 'lib/todos_cli.rb', line 128

def self.execute
  puts 'List of contests'
  contexts = Context.active
  unless contexts.empty?
    print_list(contexts)
    conditions = { :done => false }.merge(Asker.single(:context_id))
    BasicTaskList.execute(conditions)
  else
    puts 'There are no contexts'
  end
end