Class: DNS::QType

Inherits:
Type
  • Object
show all
Defined in:
lib/faildns/qtype.rb

Overview

– QTYPE fields appear in the question part of a query. QTYPES are a superset of TYPEs, hence all TYPEs are valid QTYPEs. In addition, the following QTYPEs are defined:

AXFR 252 A request for a transfer of an entire zone

MAILB 253 A request for mailbox-related records (MB, MG or MR)

MAILA 254 A request for mail agent RRs (Obsolete - see MX)

  • 255 A request for all records

++

Constant Summary collapse

Values =
{
  252 => :AXFR,
  253 => :MAILB,
  254 => :MAILA,
  255 => :ANY
}

Instance Attribute Summary

Attributes inherited from Type

#value

Instance Method Summary collapse

Methods inherited from Type

#==, length, #pack, parse

Constructor Details

#initialize(value) ⇒ QType

Returns a new instance of QType.



47
48
49
# File 'lib/faildns/qtype.rb', line 47

def initialize (value)
  super(value)
end

Instance Method Details

#to_sObject



55
56
57
# File 'lib/faildns/qtype.rb', line 55

def to_s
  (Values[@value] || Type::Values[@value]).to_s
end

#to_symObject



51
52
53
# File 'lib/faildns/qtype.rb', line 51

def to_sym
  Values[@value] || Type::Values[@value]
end