| Class | Dnsruby::Name |
| In: |
lib/dnsruby/name.rb
|
| Parent: | Object |
| MaxNameLength | = | 255 |
| == | -> | eql? |
| labels | [RW] |
—
A Name is a collection of Labels. Each label is presentation-formatted When a Name is wire-encoded, the label array is walked, and each label is wire-encoded. When a Name is unencoded, each label is unencoded, and added to the Name collection of labels. When a Name is made from a string, the Name is split into Labels.
++ Creates a new Dnsruby::Name from arg. arg can be :
Tests subdomain-of relation : returns true if this name is a subdomain of other.
domain = Resolv::Name.create("y.z")
p Resolv::Name.create("w.x.y.z").subdomain_of?(domain) #=> true
p Resolv::Name.create("x.y.z").subdomain_of?(domain) #=> true
p Resolv::Name.create("y.z").subdomain_of?(domain) #=> false
p Resolv::Name.create("z").subdomain_of?(domain) #=> false
p Resolv::Name.create("x.y.z.").subdomain_of?(domain) #=> false
p Resolv::Name.create("w.z").subdomain_of?(domain) #=> false