lib/defcli/formatting.rb
# Add a tab at the beginning of a text. If it's a list, add a tab at
# the beginning of each element.
# @param txt [String] The text to tab, may be a string or a list of
#                     strings
# @param width [Integer] tab width
# @return [String]
Add a tab at the beginning of a text. If it's a list, add a tab at
the beginning of each element.
Add a tab at the beginning of a text . If it ' s a list add a tab at the beginning of each element .
def tab(txt, width = 4)
        return txt if width <= 0
        tab = " " * width
        return tab + txt if txt.is_a? String
        txt.map { |l| tab + l }
      end
def tab ( txt , width = 4 ) return txt if width <= 0 tab = " " * width return tab + txt if txt . is_a? String txt . map { | l | tab + l } end
Add a tab at the beginning of a text.
Add a tab at the beginning of a text .
None
String
txt
The text to tab, may be a string or a list of strings
The text to tab may be a string or a list of strings
width
None