Class: Resolv::DNS::Resource::IN::A

Inherits:
Resolv::DNS::Resource show all
Defined in:
lib/net/dns/resolv.rb

Constant Summary

Constants inherited from Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes, ClassValue

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resolv::DNS::Resource

#==, #eql?, get_class, #hash

Constructor Details

#initialize(address) ⇒ A

Returns a new instance of A.



1718
1719
1720
# File 'lib/net/dns/resolv.rb', line 1718

def initialize(address)
  @address = IPv4.create(address)
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



1721
1722
1723
# File 'lib/net/dns/resolv.rb', line 1721

def address
  @address
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:



1727
1728
1729
# File 'lib/net/dns/resolv.rb', line 1727

def self.decode_rdata(msg) # :nodoc:
  return self.new(IPv4.new(msg.get_bytes(4)))
end

Instance Method Details

#encode_rdata(msg) ⇒ Object

:nodoc:



1723
1724
1725
# File 'lib/net/dns/resolv.rb', line 1723

def encode_rdata(msg) # :nodoc:
  msg.put_bytes(@address.address)
end