Class: String

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

Overview

Monkey patch into String a starts_with method

Instance Method Summary collapse

Instance Method Details

#cobweb_starts_with?(val) ⇒ Boolean

Monkey patch into String a starts_with method

Returns:

  • (Boolean)


137
138
139
140
141
142
143
# File 'lib/cobweb_crawler.rb', line 137

def cobweb_starts_with?(val)
  if self.length >= val.length
    self[0..val.length-1] == val
  else
    false
  end
end