Exception: Optionable::Unknown

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/optionable/unknown.rb

Overview

This exception is raised whenever unknown options are found during validation.

Since:

  • 0.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, names) ⇒ Unknown

Initialize the unknown option exception.

Examples:

Initialize the exception.

Optionable::Unknown.new(:test, [ :read, :write ])

Parameters:

  • key (Symbol)

    The name of the option.

  • names (Array<Symbol>)

    The valid option names.

Since:

  • 0.0.0



25
26
27
28
29
# File 'lib/optionable/unknown.rb', line 25

def initialize(key, names)
  @key = key
  @names = names
  super(generate_message)
end

Instance Attribute Details

#keySymbol

Returns The name of the option.

Returns:

  • (Symbol)

    The name of the option.



14
15
16
# File 'lib/optionable/unknown.rb', line 14

def key
  @key
end

#namesObject

Since:

  • 0.0.0



14
# File 'lib/optionable/unknown.rb', line 14

attr_reader :key, :names