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

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

Constant Summary

Constants inherited from Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes, ClassValue

Instance Attribute Summary collapse

Attributes inherited from Resolv::DNS::Resource

#ttl

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.



1606
1607
1608
# File 'lib/logmerge/resolv.rb', line 1606

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

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



1609
1610
1611
# File 'lib/logmerge/resolv.rb', line 1609

def address
  @address
end

Class Method Details

.decode_rdata(msg) ⇒ Object



1615
1616
1617
# File 'lib/logmerge/resolv.rb', line 1615

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

Instance Method Details

#encode_rdata(msg) ⇒ Object



1611
1612
1613
# File 'lib/logmerge/resolv.rb', line 1611

def encode_rdata(msg)
  msg.put_bytes(@address.address)
end