lib/tty/prompt/suggestion.rb in tty-prompt-0.15.0 vs lib/tty/prompt/suggestion.rb in tty-prompt-0.16.0
- old
+ new
@@ -1,6 +1,7 @@
# encoding: utf-8
+# frozen_string_literal: true
require_relative 'distance'
module TTY
# A class responsible for terminal prompt interactions.
@@ -95,19 +96,16 @@
end
end
# @api private
def build_single_suggestion
- suggestion = ''
- suggestion << single_text + "\n"
- suggestion << (' ' * indent + @suggestions.first)
+ single_text + "\n" + (' ' * indent) + @suggestions.first
end
# @api private
def build_multiple_suggestions
- suggestion = ''
- suggestion << plural_text + "\n"
- suggestion << @suggestions.map do |sugest|
+ plural_text + "\n" +
+ @suggestions.map do |sugest|
' ' * indent + sugest
end.join("\n")
end
end # Suggestion
end # Prompt