Ruby List Functions

EditRocket provides the following information on List functions in the Ruby source code builder.

accept(t, pat = /.*/nm, &block) - See OptionParser.accept.

append(*args) - "Appends switch at the tail of the list, and associates short, long and negated long options. Arguments are:"

complete(id, opt, icase = false, *pat, &block) - Searches list id for opt and the optional patterns for completion pat. If icase is true, the search is case insensitive. The result is returned or yielded if a block is given. If it isn't found, nil is returned.

each_option(&block) - Iterates over each option, passing the option to the block.

new() - Just initializes all instance variables.

prepend(*args) - "Inserts switch at the head of the list, and associates short, long and negated long options. Arguments are:"

reject(t) - See OptionParser.reject.

search(id, key) - Searches key in id list. The result is returned or yielded if a block is given. If it isn't found, nil is returned.

summarize(*args, &block) - Creates the summary table, passing each line to the block (without newline). The arguments args are passed along to the summarize method which is called on every option.