module Riffer::Rig::Terminal::Question
Constants
- INDENT
Public Instance Methods
(Riffer::Rig::Terminal::Theme theme, String? question, Array[String]? options, Integer? width) → Array[String]
Source
# File lib/riffer/rig/terminal/question.rb, line 13 def lines(theme, question, options, width) numbered = (options || []).each.with_index(1).flat_map do |option, number| lead = "#{' ' * INDENT}#{theme.magenta("#{number}.")} " hang(lead, option, Riffer::Rig::Terminal::Columns.width(lead), width) end [question].compact.flat_map { |text| hang('', text, INDENT, width) } + numbered end
@rbs theme: Riffer::Rig::Terminal::Theme @rbs question: String? @rbs options: Array? @rbs width: Integer? @rbs return: Array