Class: Gem::Resolv::DNS::Resource

Inherits:
Query
  • Object
show all
Defined in:
lib/rubygems/vendor/resolv/lib/resolv.rb

Overview

A DNS resource abstract class.

Direct Known Subclasses

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

Defined Under Namespace

Modules: IN Classes: ANY, CAA, CNAME, DomainName, Generic, HINFO, LOC, 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, LOC, ANY, CAA
]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ttlObject (readonly)

Remaining Time To Live for this Resource.



2111
2112
2113
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2111

def ttl
  @ttl
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:

Raises:

  • (NotImplementedError)


2119
2120
2121
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2119

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

.get_class(type_value, class_value) ⇒ Object

:nodoc:



2150
2151
2152
2153
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2150

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

:nodoc:



2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2123

def ==(other) # :nodoc:
  return false unless self.class == other.class
  s_ivars = self.instance_variables
  s_ivars.sort!
  s_ivars.delete :@ttl
  o_ivars = other.instance_variables
  o_ivars.sort!
  o_ivars.delete :@ttl
  return s_ivars == o_ivars &&
    s_ivars.collect {|name| self.instance_variable_get name} ==
      o_ivars.collect {|name| other.instance_variable_get name}
end

#encode_rdata(msg) ⇒ Object

:nodoc:

Raises:

  • (NotImplementedError)


2115
2116
2117
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2115

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

#eql?(other) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


2136
2137
2138
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2136

def eql?(other) # :nodoc:
  return self == other
end

#hashObject

:nodoc:



2140
2141
2142
2143
2144
2145
2146
2147
2148
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2140

def hash # :nodoc:
  h = 0
  vars = self.instance_variables
  vars.delete :@ttl
  vars.each {|name|
    h ^= self.instance_variable_get(name).hash
  }
  return h
end