Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/dashcode-converter.rb
Direct Known Subclasses
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_indent ⇒ Object
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 |