Class: Interactive::HashNumberedOption
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Interactive::HashNumberedOption
- Defined in:
- lib/interactive/option.rb
Instance Method Summary collapse
-
#initialize(option) ⇒ HashNumberedOption
constructor
A new instance of HashNumberedOption.
- #query_method_name ⇒ Object
- #shortcut_value ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(option) ⇒ HashNumberedOption
Returns a new instance of HashNumberedOption.
57 58 59 60 |
# File 'lib/interactive/option.rb', line 57 def initialize(option) @option = option super(@option) end |
Instance Method Details
#query_method_name ⇒ Object
66 67 68 |
# File 'lib/interactive/option.rb', line 66 def query_method_name "whole_number_#{shortcut_value}?" end |
#shortcut_value ⇒ Object
62 63 64 |
# File 'lib/interactive/option.rb', line 62 def shortcut_value @option.keys.first end |
#value ⇒ Object
70 71 72 |
# File 'lib/interactive/option.rb', line 70 def value @option[shortcut_value] end |