Class: Achoo::Plugin::Homescreen

Inherits:
Achoo::PluginBase
  • Object
show all
Includes:
UI::ExceptionHandling
Defined in:
lib/achoo/plugin/homescreen.rb

Instance Method Summary collapse

Instance Method Details

#at_startupObject



13
14
15
# File 'lib/achoo/plugin/homescreen.rb', line 13

def at_startup
  Term::clearscreen
end

#before_print_menu(date) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/achoo/plugin/homescreen.rb', line 17

def before_print_menu(date)
  form = Achievo::HourAdministrationForm.new
  Term::clearscreen

  case RC[:homescreen]
  when 'day'
    form.show_registered_hours_for_day(date)
  when 'week'
    form.show_registered_hours_for_week(date)
  else
    printf "Unknown homescreen '%s', ignoring\n", RC['homescreen']
  end
end

#state_ok?Boolean

Returns:

  • (Boolean)


11
# File 'lib/achoo/plugin/homescreen.rb', line 11

def state_ok?; RC.has_key?(:homescreen); end