Exception: BadOptionValueError

Inherits:
OptionError show all
Defined in:
lib/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#klassObject (readonly)

Returns the value of attribute klass.



13
14
15
# File 'lib/options.rb', line 13

def klass
  @klass
end

#klass_expectedObject (readonly)

Returns the value of attribute klass_expected.



13
14
15
# File 'lib/options.rb', line 13

def klass_expected
  @klass_expected
end

#optObject (readonly)

Returns the value of attribute opt.



13
14
15
# File 'lib/options.rb', line 13

def opt
  @opt
end