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

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Str

Returns a new instance of Str.


1200
1201
1202
1203
1204
1205
# File 'lib/resolv.rb', line 1200

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.


1206
1207
1208
# File 'lib/resolv.rb', line 1206

def downcase
  @downcase
end

#stringObject (readonly)

Returns the value of attribute string.


1206
1207
1208
# File 'lib/resolv.rb', line 1206

def string
  @string
end

Instance Method Details

#==(other) ⇒ Object


1216
1217
1218
# File 'lib/resolv.rb', line 1216

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

1220
1221
1222
# File 'lib/resolv.rb', line 1220

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

#hashObject


1224
1225
1226
# File 'lib/resolv.rb', line 1224

def hash
  return @downcase.hash
end

#inspectObject


1212
1213
1214
# File 'lib/resolv.rb', line 1212

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

#to_sObject


1208
1209
1210
# File 'lib/resolv.rb', line 1208

def to_s
  return @string
end