Class: PublicSuffix::Domain

Inherits:
Object
  • Object
show all
Defined in:
lib/cms_scanner/public_suffix/domain.rb

Overview

Monkey Patch to include the match logic

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

For Sanity



5
6
7
# File 'lib/cms_scanner/public_suffix/domain.rb', line 5

def ==(other)
  name == other.name
end

#match(pattern) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
# File 'lib/cms_scanner/public_suffix/domain.rb', line 11

def match(pattern)
  pattern = PublicSuffix.parse(pattern) unless pattern.is_a?(PublicSuffix::Domain)

  return name == pattern.name unless pattern.trd
  return false unless tld == pattern.tld && sld == pattern.sld

  matching_pattern?(pattern)
end