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

Returns:

  • (Boolean)


24
25
26
# File 'lib/fat_table/patches.rb', line 24

def match?(regexp)
  self =~ regexp
end

#strip_heredocObject



42
43
44
45
# File 'lib/fat_table/patches.rb', line 42

def strip_heredoc
  indent = chomp.scan(/^\s*/).min.size
  gsub(/^\s{#{indent}}/, '')
end