Methods
Public Instance methods
[ show source ]
# File lib/facets/more/cookie.rb, line 59 def domain_match(host, domain) case domain when /\d+\.\d+\.\d+\.\d+/ return (host == domain) when '.' return true when /^\./ return tail_match?(domain, host) else return (host == domain) end end
[ show source ]
# File lib/facets/more/cookie.rb, line 47 def head_match?(str1, str2) str1 == str2[0, str1.length] end
[ show source ]
# File lib/facets/more/cookie.rb, line 51 def tail_match?(str1, str2) if str1.length > 0 str1 == str2[-str1.length..-1].to_s else true end end
[ show source ]
# File lib/facets/more/cookie.rb, line 72 def total_dot_num(string) string.scan(/\./).length() end