Class: Todos::Commands::GeneralCommands::ListProjects

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

Constant Summary collapse

KEY =
'p'
DESCRIPTION =
'List projects'

Class Method Summary collapse

Methods included from BasicList

print_list

Class Method Details

.executeObject



145
146
147
148
149
150
151
152
153
154
155
# File 'lib/todos_cli.rb', line 145

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