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

Inherits:
Gem::Resolv::DNS::SvcParam show all
Defined in:
lib/rubygems/vendor/resolv/lib/resolv.rb

Overview

Generic SvcParam abstract class.

Constant Summary

Constants inherited from Gem::Resolv::DNS::SvcParam

ClassHash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gem::Resolv::DNS::SvcParam

key_name, key_number

Constructor Details

#initialize(value) ⇒ Generic

Create generic SvcParam



1864
1865
1866
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1864

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

SvcParamValue in wire-format byte string.



1859
1860
1861
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1859

def value
  @value
end

Class Method Details

.create(key_number) ⇒ Object



1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1876

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) ⇒ Object

:nodoc:



1872
1873
1874
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1872

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

Instance Method Details

#encode(msg) ⇒ Object

:nodoc:



1868
1869
1870
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1868

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