class String

Monkey patch into String a starts_with method

Public Instance Methods

cobweb_ends_with?(val) click to toggle source
# File lib/string.rb, line 3
def cobweb_ends_with?(val)
  suffix = val
  suffix.respond_to?(:to_str) && self[-suffix.length, suffix.length] == suffix
end
cobweb_starts_with?(val) click to toggle source

Monkey patch into String a starts_with method

# File lib/cobweb_crawler.rb, line 171
def cobweb_starts_with?(val)
  if self.length >= val.length
    self[0..val.length-1] == val
  else
    false
  end
end