Exception: UsageMod::InvalidChoiceError

Inherits:
Error
  • Object
show all
Defined in:
lib/Usage.rb

Overview

The user specified an invalid choice when the program was run

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#choiceObject (readonly)

Returns the value of attribute choice.



65
66
67
# File 'lib/Usage.rb', line 65

def choice
  @choice
end

#optionObject (readonly)

Returns the value of attribute option.



65
66
67
# File 'lib/Usage.rb', line 65

def option
  @option
end