Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/fat_table/patches.rb,
lib/fat_table/patches.rb
Overview
Patch String to provide heredocs with whitespace stripped
Instance Method Summary collapse
Instance Method Details
#match?(regexp) ⇒ Boolean
21 22 23 |
# File 'lib/fat_table/patches.rb', line 21 def match?(regexp) self =~ regexp end |
#strip_heredoc ⇒ Object
39 40 41 42 |
# File 'lib/fat_table/patches.rb', line 39 def strip_heredoc indent = chomp.scan(/^\s*/).min.size gsub(/^\s{#{indent}}/, '') end |