Class: ChooseProjectScreen

Inherits:
Screen
  • Object
show all
Defined in:
lib/kale/ui.rb

Instance Method Summary collapse

Methods inherited from Screen

#initialize

Constructor Details

This class inherits a constructor from Screen

Instance Method Details

#handle_menuObject



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/kale/ui.rb', line 84

def handle_menu
  answer = gets.chomp

  if answer.length == 1
    @@project = Project[:id => answer]
  else
    @@project = Project[:name => answer]
  end

  if @@project
    ShowProjectScreen.new
  else
    system "clear"
    puts "You are a bad typer, or maybe that project does not exist."
    sleep(2)
    ChooseProjectScreen.new
  end
end

#infoObject



76
77
78
# File 'lib/kale/ui.rb', line 76

def info
  show_projects true
end


80
81
82
# File 'lib/kale/ui.rb', line 80

def menu
  puts "Type the number or name of the project"
end