Class: Coals::Menu
- Inherits:
-
Object
- Object
- Coals::Menu
- Defined in:
- lib/coals/menu.rb
Instance Attribute Summary collapse
-
#selection ⇒ Object
readonly
Returns the value of attribute selection.
Instance Method Summary collapse
-
#initialize(options:, prompt: nil, title: '') ⇒ Menu
constructor
Show a menu of options in a loop until the user makes a selection.
Constructor Details
#initialize(options:, prompt: nil, title: '') ⇒ Menu
Show a menu of options in a loop until the user makes a selection. Return the selection value
10 11 12 13 14 15 16 |
# File 'lib/coals/menu.rb', line 10 def initialize(options:, prompt: nil, title: '') @select = nil @options = @title = title @prompt = prompt until @selection end |
Instance Attribute Details
#selection ⇒ Object (readonly)
Returns the value of attribute selection.
4 5 6 |
# File 'lib/coals/menu.rb', line 4 def selection @selection end |