123456789_123456789_123456789_123456789_123456789_

Class: Resolv::DNS::Resource::Generic

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Resolv::DNS::Resource
Defined in: lib/resolv.rb

Overview

A generic resource abstract class.

Constant Summary

::Resolv::DNS::Resource - Inherited

ClassHash, ClassInsensitiveTypes, ClassValue

Class Method Summary

::Resolv::DNS::Resource - Inherited

::Resolv::DNS::Query - Inherited

Instance Attribute Summary

  • #data readonly

    Data for this generic resource.

::Resolv::DNS::Resource - Inherited

#ttl

Remaining Time To Live for this ::Resolv::DNS::Resource.

Instance Method Summary

Constructor Details

.new(data) ⇒ Generic

Creates a new generic resource.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2160

def initialize(data)
  @data = data
end

Class Method Details

.create(type_value, class_value)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2177

def self.create(type_value, class_value) # :nodoc:
  c = Class.new(Generic)
  c.const_set(:TypeValue, type_value)
  c.const_set(:ClassValue, class_value)
  Generic.const_set("Type#{type_value}_Class#{class_value}", c)
  ClassHash[[type_value, class_value]] = c
  return c
end

.decode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2173

def self.decode_rdata(msg) # :nodoc:
  return self.new(msg.get_bytes)
end

Instance Attribute Details

#data (readonly)

Data for this generic resource.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2167

attr_reader :data

Instance Method Details

#encode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2169

def encode_rdata(msg) # :nodoc:
  msg.put_bytes(data)
end