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)


62
63
64
# File 'lib/hatchet.rb', line 62

def match?(value)
  self =~ value
end

#strip_heredocObject



53
54
55
# File 'lib/hatchet.rb', line 53

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