Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/utils.rb

Instance Method Summary collapse

Instance Method Details

#indent(n) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/utils.rb', line 8

def indent(n)
  if n >= 0
    gsub(/^/, ' ' * n)
  else
    gsub(/^ {0,#{-n}}/, "")
  end
end