Class: Ronin::Support::Network::PublicSuffix::SuffixSet
- Inherits:
-
Object
- Object
- Ronin::Support::Network::PublicSuffix::SuffixSet
- Includes:
- Enumerable
- Defined in:
- lib/ronin/support/network/public_suffix/suffix_set.rb
Overview
A sub-set of public suffixes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#suffixes ⇒ Array<Suffix>, Enumerator::Lazy<Suffix>
readonly
The suffixes in the suffix set.
Instance Method Summary collapse
-
#<<(suffix) ⇒ self
private
Adds a public suffix to the suffix-set.
-
#each {|suffix| ... } ⇒ Enumerator
Enumerates over each suffix within the suffix-set.
-
#icann ⇒ SuffixSet
Selects all ICANN suffixes.
-
#initialize(suffixes = []) ⇒ SuffixSet
constructor
private
Initializes the suffix-set.
-
#length ⇒ Integer
The number of suffixes within the suffix-set.
-
#non_wildcards ⇒ SuffixSet
Selects all non-wildcard suffixes.
-
#private ⇒ SuffixSet
Selects all private suffixes.
-
#to_a ⇒ Array<Suffix>
Converts the suffix-set to an Array of suffixes.
-
#type(type) ⇒ SuffixSet
Selects all suffixes with the matching type.
-
#wildcards ⇒ SuffixSet
Selects all wildcard suffixes.
Methods included from Enumerable
Constructor Details
#initialize(suffixes = []) ⇒ SuffixSet
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-set.
43 44 45 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 43 def initialize(suffixes=[]) @suffixes = suffixes end |
Instance Attribute Details
Instance Method Details
#<<(suffix) ⇒ self
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.
Adds a public suffix to the suffix-set.
57 58 59 60 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 57 def <<(suffix) @suffixes << suffix return self end |
#each {|suffix| ... } ⇒ Enumerator
Enumerates over each suffix within the suffix-set.
74 75 76 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 74 def each(&block) @suffixes.each(&block) end |
#icann ⇒ SuffixSet
Selects all ICANN suffixes.
97 98 99 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 97 def icann SuffixSet.new(lazy.select(&:icann?)) end |
#length ⇒ Integer
The number of suffixes within the suffix-set.
136 137 138 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 136 def length @suffixes.length end |
#non_wildcards ⇒ SuffixSet
Selects all non-wildcard suffixes.
127 128 129 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 127 def non_wildcards SuffixSet.new(lazy.select(&:non_wildcard?)) end |
#private ⇒ SuffixSet
Selects all private suffixes.
107 108 109 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 107 def private SuffixSet.new(lazy.select(&:private?)) end |
#to_a ⇒ Array<Suffix>
Converts the suffix-set to an Array of suffixes.
145 146 147 |
# File 'lib/ronin/support/network/public_suffix/suffix_set.rb', line 145 def to_a @suffixes.to_a end |