Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/helpers/doc.rb
Instance Method Summary collapse
-
#strip_heredoc ⇒ Object
The following methods is taken from activesupport.
Instance Method Details
#strip_heredoc ⇒ Object
The following methods is taken from activesupport
All credit for this method goes to the original authors. The code is used under the MIT license.
Strips indentation by removing the amount of leading whitespace in the least indented non-empty line in the whole string
59 60 61 |
# File 'lib/helpers/doc.rb', line 59 def strip_heredoc self.gsub(/^#{self.scan(/^[ \t]*(?=\S)/).min}/, "".freeze) end |