Class: Resolv::DNS::Resource::Generic
- Inherits:
-
Resolv::DNS::Resource
- Object
- Query
- Resolv::DNS::Resource
- Resolv::DNS::Resource::Generic
- Defined in:
- lib/resolv.rb
Constant Summary
Constants inherited from Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes, ClassValue
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #encode_rdata(msg) ⇒ Object
-
#initialize(data) ⇒ Generic
constructor
A new instance of Generic.
Methods inherited from Resolv::DNS::Resource
Constructor Details
#initialize(data) ⇒ Generic
Returns a new instance of Generic.
1408 1409 1410 |
# File 'lib/resolv.rb', line 1408 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
1411 1412 1413 |
# File 'lib/resolv.rb', line 1411 def data @data end |
Class Method Details
.create(type_value, class_value) ⇒ Object
1421 1422 1423 1424 1425 1426 1427 1428 |
# File 'lib/resolv.rb', line 1421 def self.create(type_value, class_value) 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) ⇒ Object
1417 1418 1419 |
# File 'lib/resolv.rb', line 1417 def self.decode_rdata(msg) return self.new(msg.get_bytes) end |
Instance Method Details
#encode_rdata(msg) ⇒ Object
1413 1414 1415 |
# File 'lib/resolv.rb', line 1413 def encode_rdata(msg) msg.put_bytes(data) end |