Class: Resolv::DNS::Resource

Inherits:
Query
  • Object
show all
Defined in:
lib/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 =
{}
ClassValue =

Standard (class generic) RRs

nil
ClassInsensitiveTypes =
[
  NS, CNAME, SOA, PTR, HINFO, MINFO, MX, TXT, ANY
]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.decode_rdata(msg) ⇒ Object

Raises:

  • (NotImplementedError)


1379
1380
1381
# File 'lib/resolv.rb', line 1379

def self.decode_rdata(msg)
  raise NotImplementedError.new
end

.get_class(type_value, class_value) ⇒ Object



1402
1403
1404
1405
# File 'lib/resolv.rb', line 1402

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

Instance Method Details

#==(other) ⇒ Object



1383
1384
1385
1386
1387
1388
# File 'lib/resolv.rb', line 1383

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

Raises:

  • (NotImplementedError)


1375
1376
1377
# File 'lib/resolv.rb', line 1375

def encode_rdata(msg)
  raise NotImplementedError.new
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


1390
1391
1392
# File 'lib/resolv.rb', line 1390

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

#hashObject



1394
1395
1396
1397
1398
1399
1400
# File 'lib/resolv.rb', line 1394

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