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

Inherits:
Resolv::DNS::Resource show all
Defined in:
lib/logstash/patches/resolv_9270.rb

Overview

IPv4 Address resource

Constant Summary collapse

TypeValue =
1
ClassValue =
IN::ClassValue

Constants inherited from Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes

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

Creates a new A for address.



2193
2194
2195
# File 'lib/logstash/patches/resolv_9270.rb', line 2193

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

Instance Attribute Details

#addressObject (readonly)

The Resolv::IPv4 address for this A.



2200
2201
2202
# File 'lib/logstash/patches/resolv_9270.rb', line 2200

def address
  @address
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:



2206
2207
2208
# File 'lib/logstash/patches/resolv_9270.rb', line 2206

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

Instance Method Details

#encode_rdata(msg) ⇒ Object

:nodoc:



2202
2203
2204
# File 'lib/logstash/patches/resolv_9270.rb', line 2202

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