Class: String

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

Direct Known Subclasses

Lucid::AST::DocString

Instance Method Summary collapse

Instance Method Details

#indent(n) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/lucid/lang_extend.rb', line 11

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