Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#strip_heredoc ⇒ Object
3 4 5 6 |
# File 'lib/core_ext.rb', line 3 def strip_heredoc indent = scan(%r/^[ \t]*(?=\S)/).min.size rescue 0 gsub(%r/^[ \t]{#{indent}}/, '') end |