Class: Ronin::Support::Network::PublicSuffix::Suffix Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ronin/support/network/public_suffix/suffix.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a suffix from the public suffix list.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type: :icann) ⇒ Suffix

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes the suffix.



49
50
51
52
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 49

def initialize(name, type: :icann)
  @name = name
  @type = type
end

Instance Attribute Details

#nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The suffix name.



33
34
35
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 33

def name
  @name
end

#type:icann, :private (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The suffix type.



38
39
40
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 38

def type
  @type
end

Instance Method Details

#==(other) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Compares the suffix to another object.



98
99
100
101
102
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 98

def ==(other)
  self.class == other.class &&
    @name == other.name &&
    @type == other.type
end

#icann?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Indicates whether the suffix is an ICANN domain.



59
60
61
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 59

def icann?
  @type == :icann
end

#non_wildcard?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines if the suffix does not contain a * wildcard.



86
87
88
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 86

def non_wildcard?
  !wildcard?
end

#private?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Indicates whether the suffix is a private domain.



68
69
70
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 68

def private?
  @type == :private
end

#to_sString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Converts the suffix to a String.



110
111
112
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 110

def to_s
  @name
end

#wildcard?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines if the suffix contians a * wildcard.



77
78
79
# File 'lib/ronin/support/network/public_suffix/suffix.rb', line 77

def wildcard?
  @name.include?('*')
end