lib/tty/prompt/multi_list.rb
def render_menu
        output = []

        sync_paginators if @paging_changed
        paginator.paginate(choices, @active, @per_page) do |choice, index|
          num = enumerate? ? (index + 1).to_s + @enum + ' ' : ''
          indicator = (index + 1 == @active) ?  @symbols[:marker] : ' '
          indicator += ' '
          message = if @selected.include?(choice) && !choice.disabled?
                      selected = @prompt.decorate(@symbols[:radio_on], @active_color)
                      "#{selected} #{num}#{choice.name}"
                    elsif choice.disabled?
                      @prompt.decorate(@symbols[:cross], :red) +
                        " #{num}#{choice.name} #{choice.disabled}"
                    else
                      "#{@symbols[:radio_off]} #{num}#{choice.name}"
                    end
          end_index = paginated? ? paginator.end_index : choices.size - 1
          newline = (index == end_index) ? '' : "\n"
          output << indicator + message + newline
        end

        output.join
      end
# Render menu with choices to select from
#
# @return [String]
#
# @api private
Render menu with choices to select from
Render menu with choices to select from
def render_menu
        output = []
        sync_paginators if @paging_changed
        paginator.paginate(choices, @active, @per_page) do |choice, index|
          num = enumerate? ? (index + 1).to_s + @enum + ' ' : ''
          indicator = (index + 1 == @active) ?  @symbols[:marker] : ' '
          indicator += ' '
          message = if @selected.include?(choice) && !choice.disabled?
                      selected = @prompt.decorate(@symbols[:radio_on], @active_color)
                      "#{selected} #{num}#{choice.name}"
                    elsif choice.disabled?
                      @prompt.decorate(@symbols[:cross], :red) +
                        " #{num}#{choice.name} #{choice.disabled}"
                    else
                      "#{@symbols[:radio_off]} #{num}#{choice.name}"
                    end
          end_index = paginated? ? paginator.end_index : choices.size - 1
          newline = (index == end_index) ? '' : "\n"
          output << indicator + message + newline
        end
        output.join
      end
def render_menu output = [ ] sync_paginators if @paging_changed paginator . paginate ( choices , @active , @per_page ) do | choice , index | num = enumerate? ? ( index + 1 ) . to_s + @enum + ' ' : '' indicator = ( index + 1 == @active ) ? @symbols [ :marker ] : ' ' indicator += ' ' message = if @selected . include? ( choice ) && ! choice . disabled? selected = @prompt . decorate ( @symbols [ :radio_on ] , @active_color ) "#{selected} #{num}#{choice.name}" elsif choice . disabled? @prompt . decorate ( @symbols [ :cross ] , :red ) + " #{num}#{choice.name} #{choice.disabled}" else "#{@symbols[:radio_off]} #{num}#{choice.name}" end end_index = paginated? ? paginator . end_index : choices . size - 1 newline = ( index == end_index ) ? '' : "\n" output << indicator + message + newline end output . join end
Render menu with choices to select from
Render menu with choices to select from
None
String
api
None