Class: Ronin::Support::Network::PublicSuffix::Suffix Private
- Inherits:
-
Object
- Object
- Ronin::Support::Network::PublicSuffix::Suffix
- 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
-
#name ⇒ String
readonly
private
The suffix name.
-
#type ⇒ :icann, :private
readonly
private
The suffix type.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
private
Compares the suffix to another object.
-
#icann? ⇒ Boolean
private
Indicates whether the suffix is an ICANN domain.
-
#initialize(name, type: :icann) ⇒ Suffix
constructor
private
Initializes the suffix.
-
#non_wildcard? ⇒ Boolean
private
Determines if the suffix does not contain a
*
wildcard. -
#private? ⇒ Boolean
private
Indicates whether the suffix is a private domain.
-
#to_s ⇒ String
private
Converts the suffix to a String.
-
#wildcard? ⇒ Boolean
private
Determines if the suffix contians a
*
wildcard.
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
#name ⇒ String (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_s ⇒ String
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 |