Class: Dnsruby::RR::RP
- Inherits:
-
Dnsruby::RR
- Object
- Dnsruby::RR
- Dnsruby::RR::RP
- Defined in:
- lib/Dnsruby/resource/RP.rb
Overview
Class for DNS Responsible Person (RP) resource records. RFC 1183 Section 2.2
Constant Summary collapse
Constants inherited from Dnsruby::RR
Instance Attribute Summary collapse
-
#mailbox ⇒ Object
Returns a domain name that specifies the mailbox for the responsible person.
-
#txtdomain ⇒ Object
A domain name that specifies a TXT record containing further information about the responsible person.
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
-
#from_string(input) ⇒ Object
:nodoc: all.
-
#rdata_to_string ⇒ Object
:nodoc: all.
Methods inherited from Dnsruby::RR
#==, create, #eql?, get_class, #hash, implemented_rrs, #init_defaults, new_from_data, new_from_hash, new_from_string, #rdlength, #sameRRset, #to_s
Instance Attribute Details
#mailbox ⇒ Object
Returns a domain name that specifies the mailbox for the responsible person.
25 26 27 |
# File 'lib/Dnsruby/resource/RP.rb', line 25 def mailbox @mailbox end |
#txtdomain ⇒ Object
A domain name that specifies a TXT record containing further information about the responsible person.
28 29 30 |
# File 'lib/Dnsruby/resource/RP.rb', line 28 def txtdomain @txtdomain end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc: all
60 61 62 63 64 |
# File 'lib/Dnsruby/resource/RP.rb', line 60 def self.decode_rdata(msg) #:nodoc: all mailbox = msg.get_name txtdomain = msg.get_name return self.new([mailbox, txtdomain]) end |
Instance Method Details
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all
55 56 57 58 |
# File 'lib/Dnsruby/resource/RP.rb', line 55 def encode_rdata(msg, canonical=false) #:nodoc: all msg.put_name(@mailbox, canonical) msg.put_name(@txtdomain, canonical) end |
#from_data(data) ⇒ Object
:nodoc: all
35 36 37 |
# File 'lib/Dnsruby/resource/RP.rb', line 35 def from_data(data) #:nodoc: all @mailbox, @txtdomain= data end |
#from_hash(hash) ⇒ Object
30 31 32 33 |
# File 'lib/Dnsruby/resource/RP.rb', line 30 def from_hash(hash) @mailbox = Name.create(hash[:mailbox]) @txtdomain = Name.create(hash[:txtdomain]) end |
#from_string(input) ⇒ Object
:nodoc: all
39 40 41 42 43 44 45 |
# File 'lib/Dnsruby/resource/RP.rb', line 39 def from_string(input) #:nodoc: all if (input.length > 0) names = input.split(" ") @mailbox = Name.create(names[0]) @txtdomain = Name.create(names[1]) end end |
#rdata_to_string ⇒ Object
:nodoc: all
47 48 49 50 51 52 53 |
# File 'lib/Dnsruby/resource/RP.rb', line 47 def rdata_to_string #:nodoc: all if (@mailbox!=nil) return "#{@mailbox} #{@txtdomain}" else return "" end end |