class String
Public Instance Methods
exclude?(str)
click to toggle source
The inverse of String#include?
. Returns true
if the string does not contain str
.
# File lib/secret_sauce/core_ext/string.rb, line 9 def exclude? str !include? str end
Also aliased as: excludes?
heredoc()
click to toggle source
Left-aligns a heredoc by finding the lest indented line in the string, and removing that amount of leading whitespace.
# File lib/secret_sauce/core_ext/string.rb, line 16 def heredoc gsub /^[ \t]{#{scan(/^[ \t]*(?=\S)/).min.size}}/, "" end
Also aliased as: format_heredoc, strip_heredoc