class DoWorkScreen

Public Class Methods

new() click to toggle source
Calls superclass method Screen::new
# File lib/kale/ui.rb, line 164
def initialize
  @session = Session.new
  super
end

Public Instance Methods

handle_menu() click to toggle source
# File lib/kale/ui.rb, line 179
def handle_menu
  answer = gets.chomp

  if answer == "1"
    puts "Enter a description for the work you just completed."
    description = gets.chomp
    @session.stop({ :description => description, :project => @@project })
    system "clear"
    puts "You worked for #{seconds_to_hms(@session.elapsed_time)} on \"#{@session.description}\" and earned #{@session.earned}"
    sleep(4)

    ShowProjectScreen.new
  elsif answer == "2"
    # TODO put in check to verify user wants to discard work
    ShowProjectScreen.new
  end
end
info() click to toggle source
# File lib/kale/ui.rb, line 169
def info
  show_project_heading
end
menu() click to toggle source
Calls superclass method Screen#menu