Class: Dnsruby::RR::NXT::TypeBitmap

### Home Classes Methods

### In Files

- lib/dnsruby/resource/NXT.rb

### Parent

Object

### Methods

- ::from_binary_string
- ::from_names_string
- ::from_type_codes
- ::new
- #to_binary_string
- #to_s
- #to_type_array

### Files

- DNSSEC
- EVENTMACHINE
- EXAMPLES

### Class/Module Index

Quicksearch

- Dnsruby
- Dnsruby::Algorithms
- Dnsruby::BitMapping
- Dnsruby::Bitmap
- Dnsruby::Classes
- Dnsruby::CodeMapper
- Dnsruby::Config
- Dnsruby::DNS
- Dnsruby::DecodeError
- Dnsruby::Dnssec
- Dnsruby::Dnssec::ValidationPolicy
- Dnsruby::EncodeError
- Dnsruby::ExtendedRCode
- Dnsruby::FormErr
- Dnsruby::Header
- Dnsruby::Hosts
- Dnsruby::IPv4
- Dnsruby::IPv6
- Dnsruby::Message
- Dnsruby::Message::SecurityLevel
- Dnsruby::MetaTypes
- Dnsruby::Modes
- Dnsruby::NXDomain
- Dnsruby::NXRRSet
- Dnsruby::Name
- Dnsruby::Name::Label
- Dnsruby::NotAuth
- Dnsruby::NotImp
- Dnsruby::NotZone
- Dnsruby::Nsec3HashAlgorithms
- Dnsruby::OpCode
- Dnsruby::OtherResolvError
- Dnsruby::QTypes
- Dnsruby::Question
- Dnsruby::RCode
- Dnsruby::RR
- Dnsruby::RR::ANY
- Dnsruby::RR::CERT
- Dnsruby::RR::CERT::CertificateTypes
- Dnsruby::RR::CNAME
- Dnsruby::RR::DHCID
- Dnsruby::RR::DLV
- Dnsruby::RR::DNAME
- Dnsruby::RR::DNSKEY
- Dnsruby::RR::DS
- Dnsruby::RR::DS::DigestTypes
- Dnsruby::RR::DomainName
- Dnsruby::RR::GPOS
- Dnsruby::RR::Generic
- Dnsruby::RR::HINFO
- Dnsruby::RR::HIP
- Dnsruby::RR::IN
- Dnsruby::RR::IN::A
- Dnsruby::RR::IN::AAAA
- Dnsruby::RR::IN::AFSDB
- Dnsruby::RR::IN::PX
- Dnsruby::RR::IN::SRV
- Dnsruby::RR::IN::WKS
- Dnsruby::RR::IPSECKEY
- Dnsruby::RR::ISDN
- Dnsruby::RR::KX
- Dnsruby::RR::LOC
- Dnsruby::RR::MB
- Dnsruby::RR::MG
- Dnsruby::RR::MINFO
- Dnsruby::RR::MR
- Dnsruby::RR::MX
- Dnsruby::RR::NAPTR
- Dnsruby::RR::NS
- Dnsruby::RR::NSAP
- Dnsruby::RR::NSEC
- Dnsruby::RR::NSEC3
- Dnsruby::RR::NSEC3PARAM
- Dnsruby::RR::NXT
- Dnsruby::RR::NXT::NxtTypes
- Dnsruby::RR::NXT::TypeBitmap
- Dnsruby::RR::OPT
- Dnsruby::RR::PTR
- Dnsruby::RR::RP
- Dnsruby::RR::RRSIG
- Dnsruby::RR::RT
- Dnsruby::RR::SOA
- Dnsruby::RR::SPF
- Dnsruby::RR::SSHFP
- Dnsruby::RR::SSHFP::Algorithms
- Dnsruby::RR::SSHFP::FpTypes
- Dnsruby::RR::TKEY
- Dnsruby::RR::TSIG
- Dnsruby::RR::TXT
- Dnsruby::RR::X25
- Dnsruby::RRSet
- Dnsruby::Recursor
- Dnsruby::Refused
- Dnsruby::Resolv
- Dnsruby::ResolvError
- Dnsruby::ResolvTimeout
- Dnsruby::Resolver
- Dnsruby::Resolver::EventType
- Dnsruby::Section
- Dnsruby::SelectThread
- Dnsruby::ServFail
- Dnsruby::SingleResolver
- Dnsruby::SocketEofResolvError
- Dnsruby::TheLog
- Dnsruby::TsigError
- Dnsruby::TsigNotSignedResponseError
- Dnsruby::Types
- Dnsruby::Update
- Dnsruby::VerifyError
- Dnsruby::YXDomain
- Dnsruby::YXRRSet
- Dnsruby::ZoneReader
- Dnsruby::ZoneReader::ParseException
- Dnsruby::ZoneSerialError
- Dnsruby::ZoneTransfer
- Dnsruby::ZoneTransfer::Delta
- Base32
- Object

No matching classes.

# Dnsruby::RR::NXT::TypeBitmap

### Attributes

bitmap[RW]

### Public Class Methods

from_binary_string(binary_string) click to toggle source

Create an instance from a binary string, e.g. from a NXT record RDATA:

    # File lib/dnsruby/resource/NXT.rb, line 271
    def self.from_binary_string(binary_string)
      new(BitMapping.binary_string_to_number(binary_string))
    end

from_names_string(names_string) click to toggle source

Create an instance from a string containing type names separated by spaces e.g. "A TXT NXT"

    # File lib/dnsruby/resource/NXT.rb, line 260
    def self.from_names_string(names_string)
      type_codes = BitMapping.names_string_to_codes(names_string)
      from_type_codes(type_codes)
    end

from_type_codes(type_codes) click to toggle source

Create an instance from type numeric codes (e.g. 30 for NXT).

    # File lib/dnsruby/resource/NXT.rb, line 266
    def self.from_type_codes(type_codes)
      new(BitMapping.set_bit_position_array_to_number(type_codes))
    end

new(bitmap_number) click to toggle source

The constructor is made private so that the name of the method called to create the instance reveals to the reader the type of the initial data.

    # File lib/dnsruby/resource/NXT.rb, line 278
    def initialize(bitmap_number)
      NxtTypes.assert_legal_bitmap_value(bitmap_number)
      @bitmap = Bitmap.from_number(bitmap_number)
    end

### Public Instance Methods

to_binary_string() click to toggle source

Returns a binary string representing this data, in as few bytes as possible (i.e. no leading zero bytes).

    # File lib/dnsruby/resource/NXT.rb, line 285
    def to_binary_string
      bitmap.to_binary_string
    end

to_s() click to toggle source

Output types in dig format, e.g. "A AAAA NXT"

    # File lib/dnsruby/resource/NXT.rb, line 295
    def to_s
      type_codes = bitmap.to_set_bit_position_array
      NxtTypes.codes_to_string(type_codes)
    end

to_type_array() click to toggle source

Returns the instance's data as an array of type codes.

    # File lib/dnsruby/resource/NXT.rb, line 290
    def to_type_array
      bitmap.to_set_bit_position_array
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.