Class: String

Inherits:
Object
  • Object
show all
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_heredocObject



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