Class: OptionParser::CompletingHash

Inherits:
Hash
  • Object
show all
Includes:
Completion
Defined in:
lib/optparse.rb

Overview

Hash with completion search feature. See OptionParser::Completion.

Instance Method Summary collapse

Methods included from Completion

#candidate, candidate, #complete, #convert, regexp

Instance Method Details

#match(key) ⇒ Object

Completion for hash key.



754
755
756
757
758
759
# File 'lib/optparse.rb', line 754

def match(key)
  *values = fetch(key) {
    raise AmbiguousArgument, catch(:ambiguous) {return complete(key)}
  }
  return key, *values
end