Class: Menu::WorktimeQueries
- Defined in:
- lib/menu/worktime/worktime_queries.rb
Overview
menu class to process the queries of different worktime intervals
Instance Attribute Summary
Attributes inherited from Base
#menu_description, #menu_items
Instance Method Summary collapse
-
#define_menu_items ⇒ Object
private
method to define all printable menu items.
-
#determine_action(input) ⇒ Boolean
private
method to process the provided input.
-
#initialize ⇒ WorktimeQueries
constructor
initialization.
Methods inherited from Base
#add_menu_item, #get_entry, #handle_wrong_option, #print_menu
Constructor Details
#initialize ⇒ WorktimeQueries
initialization
9 10 11 12 |
# File 'lib/menu/worktime/worktime_queries.rb', line 9 def initialize super @menu_description = "Queries for tasks done in a given time interval." end |
Instance Method Details
#define_menu_items ⇒ Object (private)
method to define all printable menu items
17 18 19 20 21 22 |
# File 'lib/menu/worktime/worktime_queries.rb', line 17 def ("Weekly worktime.", 1) ("Monthly worktime.", 2) ("Custom worktime interval.", 3) ("Cancel and return to previous menu.", 4) end |
#determine_action(input) ⇒ Boolean (private)
method to process the provided input
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/menu/worktime/worktime_queries.rb', line 28 def determine_action(input) case (input.to_i) when 1 then TimeMenu::WeektimeMenu.new. when 2 then TimeMenu::MonthtimeMenu.new. when 3 then TimeMenu::CustomtimeMenu.new. when 4 then return false else handle_wrong_option end return true end |