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

#complete, #convert

Instance Method Details

#match(key) ⇒ Object

Completion for hash key.



667
668
669
670
671
# File 'lib/optparse.rb', line 667

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