Class: DomainSanity::IPSubject
Overview
A single IPv4 or IPv6 host address.
Constant Summary
Constants inherited
from Subject
Subject::TYPES
Instance Attribute Summary
Attributes inherited from Subject
#input, #policy
Instance Method Summary
collapse
Methods inherited from Subject
#ascii, for, #hostname?, #initialize, #kind, #punycode?, #reasons, #reverse_zone?, #to_h, #unicode, #valid?, #valid_wildcard?, #wildcard?
Instance Method Details
#ip? ⇒ Boolean
187
188
189
|
# File 'lib/domain_sanity/subject.rb', line 187
def ip?
true
end
|
#public? ⇒ Boolean
Also known as:
public_ip?
198
199
200
201
202
|
# File 'lib/domain_sanity/subject.rb', line 198
def public?
return @public if defined?(@public)
@public = IP.public?(@input)
end
|
#reserved? ⇒ Boolean
Also known as:
reserved_ip?
191
192
193
194
195
|
# File 'lib/domain_sanity/subject.rb', line 191
def reserved?
return @reserved if defined?(@reserved)
@reserved = IP.reserved?(@input)
end
|
#type_facts ⇒ Object
205
206
207
|
# File 'lib/domain_sanity/subject.rb', line 205
def type_facts
{reserved_ip: reserved?, public_ip: public?}
end
|