Class: String

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

Overview

We can get rid of this when all rubies can support String#match? method

Instance Method Summary collapse

Instance Method Details

#match?(value) ⇒ Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/hatchet.rb', line 85

def match?(value)
  self =~ value
end

#strip_heredocObject



76
77
78
# File 'lib/hatchet.rb', line 76

def strip_heredoc
  gsub(/^#{scan(/^[ \t]*(?=\S)/).min}/, "".freeze)
end