Class: Nesser::PTR
- Inherits:
-
Object
- Object
- Nesser::PTR
- Defined in:
- lib/nesser/packets/rr_types.rb
Overview
PTR record - ie, reverse DNS
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:) ⇒ PTR
constructor
A new instance of PTR.
- #pack(packer) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name:) ⇒ PTR
Returns a new instance of PTR.
186 187 188 |
# File 'lib/nesser/packets/rr_types.rb', line 186 def initialize(name:) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
184 185 186 |
# File 'lib/nesser/packets/rr_types.rb', line 184 def name @name end |
Class Method Details
.unpack(unpacker) ⇒ Object
190 191 192 193 194 195 |
# File 'lib/nesser/packets/rr_types.rb', line 190 def self.unpack(unpacker) # We don't really need the length for anything, so just discard it unpacker.unpack('n') return self.new(name: unpacker.unpack_name()) end |
Instance Method Details
#pack(packer) ⇒ Object
197 198 199 200 201 |
# File 'lib/nesser/packets/rr_types.rb', line 197 def pack(packer) length = packer.pack_name(@name, dry_run: true) packer.pack('n', length) packer.pack_name(@name) end |
#to_s ⇒ Object
203 204 205 |
# File 'lib/nesser/packets/rr_types.rb', line 203 def to_s() return "#{@name} [PTR]" end |