Class: Dnsruby::Name::Label

### Home Classes Methods

### In Files

- lib/Dnsruby/name.rb

### Parent

Object

### Methods

- ::new
- ::set_max_length
- ::split
- #<=>
- #==
- #eql?
- #hash
- #inspect
- #length
- #to_s

### Included Modules

- Comparable

### Files

- DNSSEC
- EVENTMACHINE
- EXAMPLES
- README

### Class/Module Index

Quicksearch

- Dnsruby
- Dnsruby::Algorithms
- 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::Section
- 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::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::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::SelectThread
- Dnsruby::ServFail
- Dnsruby::SingleResolver
- 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

No matching classes.

# Dnsruby::Name::Label

## Dnsruby::Label class

(RFC1035, section 3.1)

### Constants

MaxLabelLength

### Attributes

downcase[R]
string[R]

### Public Class Methods

new(string) click to toggle source

    # File lib/Dnsruby/name.rb, line 380
    def initialize(string)
      if (string.length > @@max_length)
        raise ResolvError.new("Label too long (#{string.length}, max length=#{MaxLabelLength}). Label = #{string}")
      end
      @downcase = string.downcase
      @string = string
      @string_length = string.length
    end

set_max_length(l) click to toggle source

    # File lib/Dnsruby/name.rb, line 376
    def self.set_max_length(l)
      @@max_length=l
    end

split(arg) click to toggle source

Split a Name into its component Labels

    # File lib/Dnsruby/name.rb, line 372
    def self.split(arg)
      return Name.split(arg)
    end

### Public Instance Methods

<=>(other) click to toggle source

    # File lib/Dnsruby/name.rb, line 402
    def <=>(other)
      return (@downcase <=> other.downcase)
    end

==(other) click to toggle source

    # File lib/Dnsruby/name.rb, line 407
    def ==(other)
      return @downcase == other.downcase
    end

eql?(other) click to toggle source

    # File lib/Dnsruby/name.rb, line 411
    def eql?(other)
      return self == other
    end

hash() click to toggle source

    # File lib/Dnsruby/name.rb, line 415
    def hash
      return @downcase.hash
    end

inspect() click to toggle source

    # File lib/Dnsruby/name.rb, line 398
    def inspect
      return "#<#{self.class} #{self.to_s}>"
    end

length() click to toggle source

    # File lib/Dnsruby/name.rb, line 394
    def length
      return @string_length
    end

to_s() click to toggle source

    # File lib/Dnsruby/name.rb, line 390
    def to_s
      return @string.to_s # + "."
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.