Exception: BadOptionValueError
- Inherits:
-
OptionError
- Object
- RuntimeError
- RenamerError
- OptionError
- BadOptionValueError
- Defined in:
- lib/options.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#klass_expected ⇒ Object
readonly
Returns the value of attribute klass_expected.
-
#opt ⇒ Object
readonly
Returns the value of attribute opt.
Instance Method Summary collapse
-
#initialize(opt, klass, klass_expected) ⇒ BadOptionValueError
constructor
A new instance of BadOptionValueError.
Constructor Details
#initialize(opt, klass, klass_expected) ⇒ BadOptionValueError
Returns a new instance of BadOptionValueError.
14 15 16 17 18 19 |
# File 'lib/options.rb', line 14 def initialize opt, klass, klass_expected @opt = opt @klass = klass @klass_expected = klass_expected super "#{opt} was expected to be one of #{klass_expected.to_a.flatten.join ', '} but was #{klass}." end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
13 14 15 |
# File 'lib/options.rb', line 13 def klass @klass end |
#klass_expected ⇒ Object (readonly)
Returns the value of attribute klass_expected.
13 14 15 |
# File 'lib/options.rb', line 13 def klass_expected @klass_expected end |
#opt ⇒ Object (readonly)
Returns the value of attribute opt.
13 14 15 |
# File 'lib/options.rb', line 13 def opt @opt end |