Class: Gem::Resolv::DNS::Label::Str

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems/vendor/resolv/lib/resolv.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Str

Returns a new instance of Str.



1230
1231
1232
1233
1234
1235
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1230

def initialize(string)
  @string = string
  # case insensivity of DNS labels doesn't apply non-ASCII characters. [RFC 4343]
  # This assumes @string is given in ASCII compatible encoding.
  @downcase = string.b.downcase
end

Instance Attribute Details

#downcaseObject (readonly)

Returns the value of attribute downcase.



1236
1237
1238
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1236

def downcase
  @downcase
end

#stringObject (readonly)

Returns the value of attribute string.



1236
1237
1238
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1236

def string
  @string
end

Instance Method Details

#==(other) ⇒ Object



1246
1247
1248
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1246

def ==(other)
  return self.class == other.class && @downcase == other.downcase
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


1250
1251
1252
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1250

def eql?(other)
  return self == other
end

#hashObject



1254
1255
1256
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1254

def hash
  return @downcase.hash
end

#inspectObject



1242
1243
1244
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1242

def inspect
  return "#<#{self.class} #{self}>"
end

#to_sObject



1238
1239
1240
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1238

def to_s
  return @string
end