Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OptionParser::Switch#summarize

summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = "") { |indent| ... }

Produces the summary text. Each line of the summary is yielded to the block (without newline).

sdone

Already summarized short style options keyed hash.

ldone

Already summarized long style options keyed hash.

width

Width of left side (option part). In other words, the right side (description part) starts after width columns.

max

Maximum width of left side -> the options are filled within max columns.

indent

Prefix string indents all summarized lines.

See also .pattern #switch_name .new also in 3.3 · 3.1 · 3.0