class UrlList
Base class for a blacklist and whitelist
Attributes
list[R]
Public Class Methods
new(list=[])
click to toggle source
# File lib/phisher/url_list.rb, line 9 def initialize(list=[]) @list = list.map do |url| parse(url) end end
Public Instance Methods
<<(url)
click to toggle source
# File lib/phisher/url_list.rb, line 22 def << (url) regex = parse(url) @list.push(regex) end
include?(url)
click to toggle source
# File lib/phisher/url_list.rb, line 15 def include?(url) @list.each do |regex| return true if regex.match(url) end return false end
size()
click to toggle source
# File lib/phisher/url_list.rb, line 27 def size @list.size end