Class: Resolv::DNS::Resource

Inherits:
Query
  • Object
show all
Defined in:
lib/net/dns/resolv.rb

Direct Known Subclasses

DomainName, Generic, HINFO, IN::A, IN::AAAA, IN::SRV, IN::WKS, MINFO, MX, SOA, TXT

Defined Under Namespace

Modules: IN Classes: ANY, CNAME, DomainName, Generic, HINFO, MINFO, MX, NS, PTR, SOA, TXT

Constant Summary collapse

ClassHash =

:nodoc:

{}
ClassValue =

Standard (class generic) RRs

nil
ClassInsensitiveTypes =

:nodoc:

[ # :nodoc:
  NS, CNAME, SOA, PTR, HINFO, MINFO, MX, TXT, ANY
]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:

Raises:

  • (NotImplementedError)


1477
1478
1479
# File 'lib/net/dns/resolv.rb', line 1477

def self.decode_rdata(msg) # :nodoc:
  raise NotImplementedError.new
end

.get_class(type_value, class_value) ⇒ Object

:nodoc:



1500
1501
1502
1503
# File 'lib/net/dns/resolv.rb', line 1500

def self.get_class(type_value, class_value) # :nodoc:
  return ClassHash[[type_value, class_value]] ||
         Generic.create(type_value, class_value)
end

Instance Method Details

#==(other) ⇒ Object



1481
1482
1483
1484
1485
1486
# File 'lib/net/dns/resolv.rb', line 1481

def ==(other)
  return self.class == other.class &&
    self.instance_variables == other.instance_variables &&
    self.instance_variables.collect {|name| self.instance_eval name} ==
      other.instance_variables.collect {|name| other.instance_eval name}
end

#encode_rdata(msg) ⇒ Object

:nodoc:

Raises:

  • (NotImplementedError)


1473
1474
1475
# File 'lib/net/dns/resolv.rb', line 1473

def encode_rdata(msg) # :nodoc:
  raise NotImplementedError.new
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


1488
1489
1490
# File 'lib/net/dns/resolv.rb', line 1488

def eql?(other)
  return self == other
end

#hashObject



1492
1493
1494
1495
1496
1497
1498
# File 'lib/net/dns/resolv.rb', line 1492

def hash
  h = 0
  self.instance_variables.each {|name|
    h ^= self.instance_eval("#{name}.hash")
  }
  return h
end