Class: DomainSanity::Wildcard
- Includes:
- RegistrableTypeFacts
- Defined in:
- lib/domain_sanity/subject.rb
Overview
A "*.something" wildcard name.
Constant Summary
Constants inherited from Subject
Instance Attribute Summary
Attributes inherited from Subject
Instance Method Summary collapse
- #public_suffix ⇒ Object
-
#registrable_domain ⇒ Object
The registrable domain / public suffix of the wildcard's base name.
-
#valid_wildcard? ⇒ Boolean
Baseline-Requirements-valid wildcard.
- #wildcard? ⇒ Boolean
Methods included from RegistrableTypeFacts
Methods inherited from Subject
#ascii, for, #hostname?, #initialize, #ip?, #kind, #punycode?, #reasons, #reverse_zone?, #to_h, #type_facts, #unicode, #valid?
Constructor Details
This class inherits a constructor from DomainSanity::Subject
Instance Method Details
#public_suffix ⇒ Object
174 175 176 |
# File 'lib/domain_sanity/subject.rb', line 174 def public_suffix remainder.psl&.tld end |
#registrable_domain ⇒ Object
The registrable domain / public suffix of the wildcard's base name.
170 171 172 |
# File 'lib/domain_sanity/subject.rb', line 170 def registrable_domain remainder.psl&.domain end |
#valid_wildcard? ⇒ Boolean
Baseline-Requirements-valid wildcard. A wildcard is never a plain host name, so #valid? stays false; this is the predicate to ask. Derived from the single normalized remainder, so nothing re-parses.
162 163 164 165 166 167 |
# File 'lib/domain_sanity/subject.rb', line 162 def valid_wildcard? return @valid_wildcard if defined?(@valid_wildcard) @valid_wildcard = @input.count("*") == 1 && Name.valid_wildcard_remainder?(remainder, policy: @policy) end |
#wildcard? ⇒ Boolean
155 156 157 |
# File 'lib/domain_sanity/subject.rb', line 155 def wildcard? true end |