123456789_123456789_123456789_123456789_123456789_

Class: Resolv::DNS::SvcParam::Generic

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

Overview

Generic SvcParam abstract class.

Constant Summary

::Resolv::DNS::SvcParam - Inherited

ClassHash

Class Method Summary

::Resolv::DNS::SvcParam - Inherited

.key_name

Get the presentation name of the SvcParamKey.

.key_number

Get the registered number of the SvcParamKey.

Instance Attribute Summary

  • #value readonly

    SvcParamValue in wire-format byte string.

Instance Method Summary

Constructor Details

.new(value) ⇒ Generic

Create generic ::Resolv::DNS::SvcParam

[ GitHub ]

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

def initialize(value)
  @value = value
end

Class Method Details

.create(key_number)

[ GitHub ]

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

def self.create(key_number)
  c = Class.new(Generic)
  key_name = :"key#{key_number}"
  c.const_set(:KeyName, key_name)
  c.const_set(:KeyNumber, key_number)
  self.const_set(:"Key#{key_number}", c)
  ClassHash[key_name] = ClassHash[key_number] = c
  return c
end

.decode(msg)

This method is for internal use only.
[ GitHub ]

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

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

Instance Attribute Details

#value (readonly)

SvcParamValue in wire-format byte string.

[ GitHub ]

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

attr_reader :value

Instance Method Details

#encode(msg)

This method is for internal use only.
[ GitHub ]

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

def encode(msg) # :nodoc:
  msg.put_bytes(@value)
end