Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/iv/phonic/ast.rb

Instance Method Summary collapse

Instance Method Details

#indent(n) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/iv/phonic/ast.rb', line 4

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