Class Dnsruby::CodeMapper
In: lib/Dnsruby/code_mapper.rb
Parent: Object

CodeMapper superclass looks after String to code mappings (e.g. OpCode, RCode, etc.)

Subclasses simply define a mapping of codes to variable names, and CodeMapper provides utility methods.

All strings will come out as upper case

Example :

  Types::AAAA or Types.AAAA
  rcode.string or rcode.code

Methods

<=>   ==   add_pair   inspect   maxcode   regexp   set_code   set_string   to_code   to_string   update  

Included Modules

Comparable

External Aliases

code -> to_code
string -> to_string
string -> to_s

Attributes

code  [RW] 
string  [RW] 

Public Class methods

Add new a code to the CodeMapper

Return a regular expression which matches any codes or strings from the CodeMapper.

Creates the CodeMapper from the defined constants

Public Instance methods

[Validate]