Class: Dnsruby::RR::IN::A
- Inherits:
-
Dnsruby::RR
- Object
- Dnsruby::RR
- Dnsruby::RR::IN::A
- Defined in:
- lib/dnsruby/resource/A.rb
Overview
Class for DNS Address (A) resource records.
RFC 1035 Section 3.4.1
Constant Summary
Constants inherited from Dnsruby::RR
Instance Attribute Summary collapse
-
#address ⇒ Object
The RR’s (Resolv::IPv4) address field.
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
Create the RR from a hash.
-
#from_string(input) ⇒ Object
Create the RR from a standard string.
- #rdata_to_string ⇒ Object
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
#address ⇒ Object
The RR’s (Resolv::IPv4) address field
26 27 28 |
# File 'lib/dnsruby/resource/A.rb', line 26 def address @address end |
Class Method Details
Instance Method Details
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all
46 47 48 |
# File 'lib/dnsruby/resource/A.rb', line 46 def encode_rdata(msg, canonical=false) #:nodoc: all msg.put_bytes(@address.address) end |
#from_data(data) ⇒ Object
:nodoc: all
28 29 30 |
# File 'lib/dnsruby/resource/A.rb', line 28 def from_data(data) #:nodoc: all @address = IPv4.create(data) end |
#from_hash(hash) ⇒ Object
Create the RR from a hash
33 34 35 |
# File 'lib/dnsruby/resource/A.rb', line 33 def from_hash(hash) @address = IPv4.create(hash[:address]) end |
#from_string(input) ⇒ Object
Create the RR from a standard string
38 39 40 |
# File 'lib/dnsruby/resource/A.rb', line 38 def from_string(input) @address = IPv4.create(input) end |
#rdata_to_string ⇒ Object
42 43 44 |
# File 'lib/dnsruby/resource/A.rb', line 42 def rdata_to_string return @address.to_s end |