Class: String

Inherits:
Object show all
Defined in:
lib/lucid/core_ext/string.rb

Overview

:nodoc:

Direct Known Subclasses

Lucid::AST::DocString

Instance Method Summary collapse

Instance Method Details

#indent(n) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/lucid/core_ext/string.rb', line 2

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