Class: Dnsruby::RR::IN::AAAA

Inherits:
Dnsruby::RR show all
Defined in:
lib/dnsruby/resource/AAAA.rb

Overview

Class for DNS IPv6 Address (AAAA) resource records.

RFC 1886 Section 2, RFC 1884 Sections 2.2 & 2.4.4

Constant Summary

Constants inherited from Dnsruby::RR

ClassInsensitiveTypes

Instance Attribute Summary collapse

Attributes inherited from Dnsruby::RR

#klass, #name, #rdata, #ttl, #type

Class Method Summary collapse

Instance Method Summary collapse

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

#addressObject

The RR’s (Resolv::IPv6) address field



26
27
28
# File 'lib/dnsruby/resource/AAAA.rb', line 26

def address
  @address
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc: all



48
49
50
# File 'lib/dnsruby/resource/AAAA.rb', line 48

def self.decode_rdata(msg) #:nodoc: all
  return self.new(IPv6.new(msg.get_bytes(16)))
end

Instance Method Details

#encode_rdata(msg, canonical = false) ⇒ Object

:nodoc: all



44
45
46
# File 'lib/dnsruby/resource/AAAA.rb', line 44

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/AAAA.rb', line 28

def from_data(data) #:nodoc: all
  @address = IPv6.create(data)
end

#from_hash(hash) ⇒ Object

:nodoc: all



32
33
34
# File 'lib/dnsruby/resource/AAAA.rb', line 32

def from_hash(hash) #:nodoc: all
  @address = IPv6.create(hash[:address])
end

#from_string(input) ⇒ Object

:nodoc: all



36
37
38
# File 'lib/dnsruby/resource/AAAA.rb', line 36

def from_string(input) #:nodoc: all
  @address = IPv6.create(input)
end

#rdata_to_stringObject

:nodoc: all



40
41
42
# File 'lib/dnsruby/resource/AAAA.rb', line 40

def rdata_to_string #:nodoc: all
  return @address.to_s
end