Class: RRs::OPT

Inherits:
Resource show all
Defined in:
lib/rrs/opt.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#ttl

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#==, #eql?, get_class, #hash

Constructor Details

#initialize(data) ⇒ OPT

Returns a new instance of OPT.



4
5
6
# File 'lib/rrs/opt.rb', line 4

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/rrs/opt.rb', line 3

def data
  @data
end

Class Method Details

.decode_rdata(msg) ⇒ Object



12
13
14
# File 'lib/rrs/opt.rb', line 12

def self.decode_rdata(msg)
  return self.new(msg.get_bytes)
end

Instance Method Details

#encode_rdata(msg) ⇒ Object



8
9
10
# File 'lib/rrs/opt.rb', line 8

def encode_rdata(msg)
  msg.put_bytes(data)
end