class String
Constants
- BLANK_RE
Public Instance Methods
blank?()
click to toggle source
# File lib/manifestly/utilities.rb, line 28 def blank? BLANK_RE === self end
is_i?()
click to toggle source
# File lib/manifestly/utilities.rb, line 22 def is_i? !!(self =~ /\A[-+]?[0-9]+\z/) end
starts_with?(prefix)
click to toggle source
# File lib/manifestly/utilities.rb, line 32 def starts_with?(prefix) prefix.respond_to?(:to_str) && self[0, prefix.length] == prefix end
wrap(width=78)
click to toggle source
# File lib/manifestly/utilities.rb, line 36 def wrap(width=78) gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n") end