Class: Interactive::HashNumberedOption

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/interactive/option.rb

Instance Method Summary collapse

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_nameObject



66
67
68
# File 'lib/interactive/option.rb', line 66

def query_method_name
  "whole_number_#{shortcut_value}?"
end

#shortcut_valueObject



62
63
64
# File 'lib/interactive/option.rb', line 62

def shortcut_value
  @option.keys.first
end

#valueObject



70
71
72
# File 'lib/interactive/option.rb', line 70

def value
  @option[shortcut_value]
end