Method: Pry::Helpers::Text#indent

Defined in:
lib/pry/helpers/text.rb

#indent(text, chars) ⇒ Object

Returns text indented by chars spaces.

Parameters:

  • text (String)
  • chars (Fixnum)


113
114
115
# File 'lib/pry/helpers/text.rb', line 113

def indent(text, chars)
  text.lines.map { |l| "#{' ' * chars}#{l}" }.join
end