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

Inherits:
Gem::Resolv::DNS::Resource show all
Defined in:
lib/rubygems/vendor/resolv/lib/resolv.rb

Overview

IPv4 Address resource

Constant Summary collapse

TypeValue =
1
ClassValue =
IN::ClassValue

Constants inherited from Gem::Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes

Instance Attribute Summary collapse

Attributes inherited from Gem::Resolv::DNS::Resource

#ttl

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gem::Resolv::DNS::Resource

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

Constructor Details

#initialize(address) ⇒ A

Creates a new A for address.



2646
2647
2648
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2646

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

Instance Attribute Details

#addressObject (readonly)

The Gem::Resolv::IPv4 address for this A.



2653
2654
2655
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2653

def address
  @address
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:



2659
2660
2661
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2659

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

Instance Method Details

#encode_rdata(msg) ⇒ Object

:nodoc:



2655
2656
2657
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2655

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