Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/dashcode-converter.rb

Direct Known Subclasses

JavascriptCode

Instance Method Summary collapse

Instance Method Details

#indent(str) ⇒ Object



40
41
42
# File 'lib/dashcode-converter.rb', line 40

def indent(str)
  self.gsub(/^/, str)
end

#remove_indentObject



34
35
36
37
38
39
# File 'lib/dashcode-converter.rb', line 34

def remove_indent
  str= sub(/^\n*/, "")
  match= str.match(/(^\s+)/)
  return str unless match
  str.gsub(/^#{match[1]}/, '').strip
end