Class: Menu::IndexOverviewMenu

Inherits:
Base
  • Object
show all
Includes:
Listenable
Defined in:
lib/menu/index_menus/index_overview_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

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

#initializeIndexOverviewMenu

initialization



12
13
14
15
# File 'lib/menu/index_menus/index_overview_menu.rb', line 12

def initialize
  super
  @menu_description = "Index operation menu. Select operation:"
end

Instance Method Details

#define_menu_itemsObject (private)

implementation to define the items of the menu



20
21
22
23
24
# File 'lib/menu/index_menus/index_overview_menu.rb', line 20

def define_menu_items
  add_menu_item("Create different index.", 1)
  add_menu_item("Subselect index.", 2)
  add_menu_item("Return to previous menu.", 3)
end

#determine_action(input) ⇒ Object (private)

method to specify the actions to a given input

Parameters:

  • input (String)

    the user input



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/menu/index_menus/index_overview_menu.rb', line 28

def determine_action(input)
  case (input.to_i)
    when 1
      index_menu = Menu::IndexSelectionMenu.new()
      index_menu.add_listener(:repo_listener, listeners[:repo_listener])
      index_menu.print_menu
    when 2
      notify_listeners(:initialize_subselect)
    when 3 then return
  end
end