Class: IntervalMenu
- Inherits:
-
Base
- Object
- Base
- IntervalMenu
- Includes:
- Listenable
- Defined in:
- lib/menu/time_menus/interval_menu.rb
Overview
menu class that inherits Menu::Base to create a menu for selecting time intervals
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 ⇒ IntervalMenu
constructor
initialization.
Methods included from Listenable
#add_listener, #listeners, #notify_listeners, #remove_listener
Constructor Details
#initialize ⇒ IntervalMenu
initialization
7 8 9 10 |
# File 'lib/menu/time_menus/interval_menu.rb', line 7 def initialize super @menu_description = "Interval selection menu. Specify a time interval:" end |
Instance Method Details
#define_menu_items ⇒ Object (private)
implementation to define the items of the menu
15 16 17 18 19 20 |
# File 'lib/menu/time_menus/interval_menu.rb', line 15 def ("This month.", 1) ("This week.", 2) ("Custom interval.", 3) ("Return to previous menu.", 4) end |
#determine_action(input) ⇒ Object (private)
method to specify the actions to a given input
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/menu/time_menus/interval_menu.rb', line 24 def determine_action(input) case (input.to_i) when 1 # create month time interval when 2 # create week interval when 3 # create custom interval when 3 then return end end |