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)


1425
1426
1427
# File 'lib/resolv.rb', line 1425

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

.get_class(type_value, class_value) ⇒ Object



1448
1449
1450
1451
# File 'lib/resolv.rb', line 1448

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



1429
1430
1431
1432
1433
1434
# File 'lib/resolv.rb', line 1429

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)


1421
1422
1423
# File 'lib/resolv.rb', line 1421

def encode_rdata(msg)
  raise NotImplementedError.new
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


1436
1437
1438
# File 'lib/resolv.rb', line 1436

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

#hashObject



1440
1441
1442
1443
1444
1445
1446
# File 'lib/resolv.rb', line 1440

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