Class | Net::DNS::RR::Classes |
In: |
lib/net/dns/rr/classes.rb
|
Parent: | Object |
This is an auxiliary class to handle Net::DNS::RR class field in a DNS packet.
CLASSES | = | { 'IN' => 1, # RFC 1035 'CH' => 3, # RFC 1035 'HS' => 4, # RFC 1035 'NONE' => 254, # RFC 2136 'ANY' => 255, # RFC 1035 } | Hash with the values of each RR class stored with the respective id number. |
Returns whether cls is a valid RR class.
Net::DNS::RR::Classes.valid?("IN") # => true Net::DNS::RR::Classes.valid?(1) # => true Net::DNS::RR::Classes.valid?("Q") # => false Net::DNS::RR::Classes.valid?(256) # => false Net::DNS::RR::Classes.valid?(Hash.new) # => ArgumentError
FIXME: valid? should never raise.
ArgumentError: | if cls isn‘t either a String or a Fixnum |
Returns the class in number format (default for normal use)
FIXME: inspect must return a String.