Class: Dnsruby::RR::DomainName
- Inherits:
-
Dnsruby::RR
- Object
- Dnsruby::RR
- Dnsruby::RR::DomainName
- Defined in:
- lib/dnsruby/resource/domain_name.rb
Overview
Abstract superclass for RR’s which have a domain name in the data section.
Constant Summary
Constants inherited from Dnsruby::RR
Instance Attribute Summary collapse
-
#domainname ⇒ Object
readonly
The domain name in the RR data section.
Attributes inherited from Dnsruby::RR
#klass, #name, #rdata, #ttl, #type
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc: all.
Instance Method Summary collapse
-
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all.
-
#from_data(data) ⇒ Object
:nodoc: all.
-
#from_hash(hash) ⇒ Object
:nodoc: all.
-
#from_string(input) ⇒ Object
:nodoc: all.
-
#rdata_to_string ⇒ Object
:nodoc: all.
- #set_domain_name(newname) ⇒ Object (also: #domainname=)
Methods inherited from Dnsruby::RR
#<=>, #==, #clone, create, #eql?, find_class, get_class, get_num, #hash, implemented_rrs, #init_defaults, new_from_data, new_from_hash, new_from_string, #rdlength, #sameRRset, #to_s
Instance Attribute Details
#domainname ⇒ Object (readonly)
The domain name in the RR data section.
21 22 23 |
# File 'lib/dnsruby/resource/domain_name.rb', line 21 def domainname @domainname end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc: all
51 52 53 54 55 56 57 |
# File 'lib/dnsruby/resource/domain_name.rb', line 51 def self.decode_rdata(msg) #:nodoc: all n = msg.get_name if n.length == 0 # n = nil end self.new(n) end |
Instance Method Details
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all
45 46 47 48 49 |
# File 'lib/dnsruby/resource/domain_name.rb', line 45 def encode_rdata(msg, canonical=false) #:nodoc: all if !([Classes::NONE, Classes::ANY].include? klass) || @rdata.length > 0 msg.put_name(@domainname, canonical) end end |
#from_data(data) ⇒ Object
:nodoc: all
33 34 35 |
# File 'lib/dnsruby/resource/domain_name.rb', line 33 def from_data(data) #:nodoc: all @domainname = data end |
#from_hash(hash) ⇒ Object
:nodoc: all
29 30 31 |
# File 'lib/dnsruby/resource/domain_name.rb', line 29 def from_hash(hash) #:nodoc: all set_domain_name(hash[:domainname]) end |
#from_string(input) ⇒ Object
:nodoc: all
37 38 39 |
# File 'lib/dnsruby/resource/domain_name.rb', line 37 def from_string(input) #:nodoc: all set_domain_name(input) end |
#rdata_to_string ⇒ Object
:nodoc: all
41 42 43 |
# File 'lib/dnsruby/resource/domain_name.rb', line 41 def rdata_to_string #:nodoc: all return @domainname.to_s(true) end |