lib/terminal-menu.rb
def add(label, &blk)
    # preserve exit as the last option
    last = @options.pop
    @options << {label: label, callback: blk || -> (arg) {}}
    @options << last
  end
# Public: Adds a new item to menu options.
#
# label - Label for this menu option.
# blk - Optional block that will be called once this option is selected.
Adds a new item to menu options.
label - Label for this menu option.
blk - Optional block that will be called once this option is selected.
Adds a new item to menu options . label - Label for this menu option . blk - Optional block that will be called once this option is selected .
def add(label, &blk)
    last = @options.pop
    @options << {label: label, callback: blk || -> (arg) {}}
    @options << last
  end
def add ( label , & blk ) last = @options . pop @options << { label : label , callback : blk || -> ( arg ) { } } @options << last end
Public: Adds a new item to menu options.
Public : Adds a new item to menu options .
# preserve exit as the last option
label
blk