Class: Menu::DiagramMenu
- Includes:
- Listenable
- Defined in:
- lib/menu/diagram_menu.rb
Overview
menu class that inherits Base to create a menu for the provided index creation options
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 ⇒ DiagramMenu
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 ⇒ DiagramMenu
initialization
12 13 14 15 |
# File 'lib/menu/diagram_menu.rb', line 12 def initialize super @menu_description = "Bar diagram 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/diagram_menu.rb', line 20 def ("Bar diagram for main index.", 1) ("Bar diagram for 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/diagram_menu.rb', line 28 def determine_action(input) case (input.to_i) when 1 notify_listeners(:output_barchart, :index) when 2 notify_listeners(:output_barchart, :subselect) when 3 then return end end |