Flowdock
method

candidate

Importance_0
v1_9_3_392 - Show latest stable - 0 notes - Class: OptionParser::Completion
candidate(key, icase = false, pat = nil, &block) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/optparse.rb, line 231
    def self.candidate(key, icase = false, pat = nil, &block)
      pat ||= Completion.regexp(key, icase)
      candidates = []
      block.call do |k, *v|
        (if Regexp === k
           kn = nil
           k === key
         else
           kn = defined?(k.id2name) ? k.id2name : k
           pat === kn
         end) or next
        v << k if v.empty?
        candidates << [k, v, kn]
      end
      candidates
    end
Register or log in to add new notes.