Class: ShowSessionsForProjectScreen

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



224
225
226
227
228
229
230
# File 'lib/kale/ui.rb', line 224

def handle_menu
  answer = gets.chomp

  if answer == "1"
    ShowProjectScreen.new
  end
end

#infoObject



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/kale/ui.rb', line 201

def info
  show_project_heading

  puts

  if @@project.sessions.length > 0
    puts "## Work Completed\n"
    @@project.sessions.each do |s|
      puts "#{s.description} \t #{seconds_to_hms(s.elapsed_time)} \t #{s.earned}"
    end

    puts "\n## Total"
    puts "#{seconds_to_hms(@@project.total_time)} \t #{@@project.total_earned}"
  else
    puts "You haven't worked on this project yet."
  end
end


219
220
221
222
# File 'lib/kale/ui.rb', line 219

def menu
  @menu.push "Go back to project"
  super
end