Thanks to visit codestin.com
Credit goes to www.rubydoc.info

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 =
Module.new do
  module_function

  def []=(type_class_value, klass)
    type_value, class_value = type_class_value
    Resource.const_set(:"Type#{type_value}_Class#{class_value}", klass)
  end
end
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.



2130
2131
2132
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2130

def ttl
  @ttl
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:

Raises:

  • (NotImplementedError)


2145
2146
2147
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2145

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

.get_class(type_value, class_value) ⇒ Object

:nodoc:



2176
2177
2178
2179
2180
2181
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2176

def self.get_class(type_value, class_value) # :nodoc:
  cache = :"Type#{type_value}_Class#{class_value}"

  return (const_defined?(cache) && const_get(cache)) ||
         Generic.create(type_value, class_value)
end

Instance Method Details

#==(other) ⇒ Object

:nodoc:



2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2149

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)


2141
2142
2143
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2141

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

#eql?(other) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


2162
2163
2164
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2162

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

#hashObject

:nodoc:



2166
2167
2168
2169
2170
2171
2172
2173
2174
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2166

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