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



38
39
40
# File 'lib/dashcode-converter.rb', line 38

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

#remove_indentObject



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

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