Class: Resolv::DNS::Resource

Inherits:
Query
  • Object
show all
Defined in:
lib/logmerge/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
]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ttlObject (readonly)

Returns the value of attribute ttl.



1381
1382
1383
# File 'lib/logmerge/resolv.rb', line 1381

def ttl
  @ttl
end

Class Method Details

.decode_rdata(msg) ⇒ Object

Raises:

  • (NotImplementedError)


1387
1388
1389
# File 'lib/logmerge/resolv.rb', line 1387

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

.get_class(type_value, class_value) ⇒ Object



1410
1411
1412
1413
# File 'lib/logmerge/resolv.rb', line 1410

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



1391
1392
1393
1394
1395
1396
# File 'lib/logmerge/resolv.rb', line 1391

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)


1383
1384
1385
# File 'lib/logmerge/resolv.rb', line 1383

def encode_rdata(msg)
  raise NotImplementedError.new
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


1398
1399
1400
# File 'lib/logmerge/resolv.rb', line 1398

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

#hashObject



1402
1403
1404
1405
1406
1407
1408
# File 'lib/logmerge/resolv.rb', line 1402

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