Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#strip_heredocObject



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