Exception: UsageMod::InvalidChoiceError
- Defined in:
- lib/Usage.rb
Overview
The user specified an invalid choice when the program was run
Instance Attribute Summary collapse
-
#choice ⇒ Object
readonly
Returns the value of attribute choice.
-
#option ⇒ Object
readonly
Returns the value of attribute option.
Instance Method Summary collapse
-
#initialize(option, choice) ⇒ InvalidChoiceError
constructor
A new instance of InvalidChoiceError.
Constructor Details
#initialize(option, choice) ⇒ InvalidChoiceError
Returns a new instance of InvalidChoiceError.
66 67 68 69 |
# File 'lib/Usage.rb', line 66 def initialize(option, choice) @option, @choice = option, choice super("invalid choice:'#{choice}', it should be one of these:" + option.choices.join(",")) end |
Instance Attribute Details
#choice ⇒ Object (readonly)
Returns the value of attribute choice.
65 66 67 |
# File 'lib/Usage.rb', line 65 def choice @choice end |
#option ⇒ Object (readonly)
Returns the value of attribute option.
65 66 67 |
# File 'lib/Usage.rb', line 65 def option @option end |