Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/templater/core_ext/string.rb
Instance Method Summary collapse
Instance Method Details
#realign_indentation ⇒ Object
3 4 5 6 |
# File 'lib/templater/core_ext/string.rb', line 3 def realign_indentation basis = self.index(/\S/) # find the first non-whitespace character return self.to_lines.map { |s| s[basis..-1] }.join end |
#to_lines ⇒ Object
9 10 11 |
# File 'lib/templater/core_ext/string.rb', line 9 def to_lines lines.to_a end |