Class: Menu::IndexOutputMenu
- Includes:
- Listenable
- Defined in:
- lib/menu/index_menus/index_output_menu.rb
Overview
menu class that inherits Base to create a menu for creating output of a selected index
Instance Attribute Summary
Attributes inherited from Base
#menu_description, #menu_items
Instance Method Summary collapse
-
#define_menu_items ⇒ Object
private
implementation to define the items of the menu.
-
#determine_action(input) ⇒ Object
private
method to specify the actions to a given input.
-
#initialize ⇒ IndexOutputMenu
constructor
initialization.
Methods included from Listenable
#add_listener, #listeners, #notify_listeners, #remove_listener
Methods inherited from Base
#add_menu_item, #get_entry, #handle_wrong_option, #print_menu
Constructor Details
#initialize ⇒ IndexOutputMenu
initialization
12 13 14 15 |
# File 'lib/menu/index_menus/index_output_menu.rb', line 12 def initialize super @menu_description = "Index operation menu. Select operation:" end |
Instance Method Details
#define_menu_items ⇒ Object (private)
implementation to define the items of the menu
20 21 22 23 24 |
# File 'lib/menu/index_menus/index_output_menu.rb', line 20 def ("Output main index.", 1) ("Output subselect index.", 2) ("Return to previous menu.", 3) end |
#determine_action(input) ⇒ Object (private)
method to specify the actions to a given input
28 29 30 31 32 33 34 35 36 |
# File 'lib/menu/index_menus/index_output_menu.rb', line 28 def determine_action(input) case (input.to_i) when 1 notify_listeners(:generate_and_output_index) when 2 notify_listeners(:output_index_ranking) when 3 then return end end |