class 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 396
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 392
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 388
def self.split(arg)
  return Name.split(arg)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/dnsruby/name.rb, line 418
def <=>(other)
  return (@downcase <=> other.downcase)
end
==(other) click to toggle source
# File lib/dnsruby/name.rb, line 423
def ==(other)
  return @downcase == other.downcase
end
eql?(other) click to toggle source
# File lib/dnsruby/name.rb, line 427
def eql?(other)
  return self == other
end
hash() click to toggle source
# File lib/dnsruby/name.rb, line 431
def hash
  return @downcase.hash
end
inspect() click to toggle source
# File lib/dnsruby/name.rb, line 414
def inspect
  return "#<#{self.class} #{self.to_s}>"
end
length() click to toggle source
# File lib/dnsruby/name.rb, line 410
def length
  return @string_length
end
to_s() click to toggle source
# File lib/dnsruby/name.rb, line 406
def to_s
  return @string.to_s # + "."
end