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

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/patches/resolv_9270.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Str

Returns a new instance of Str.



1219
1220
1221
1222
1223
1224
# File 'lib/logstash/patches/resolv_9270.rb', line 1219

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.



1225
1226
1227
# File 'lib/logstash/patches/resolv_9270.rb', line 1225

def downcase
  @downcase
end

#stringObject (readonly)

Returns the value of attribute string.



1225
1226
1227
# File 'lib/logstash/patches/resolv_9270.rb', line 1225

def string
  @string
end

Instance Method Details

#==(other) ⇒ Object



1235
1236
1237
# File 'lib/logstash/patches/resolv_9270.rb', line 1235

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


1239
1240
1241
# File 'lib/logstash/patches/resolv_9270.rb', line 1239

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

#hashObject



1243
1244
1245
# File 'lib/logstash/patches/resolv_9270.rb', line 1243

def hash
  return @downcase.hash
end

#inspectObject



1231
1232
1233
# File 'lib/logstash/patches/resolv_9270.rb', line 1231

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

#to_sObject



1227
1228
1229
# File 'lib/logstash/patches/resolv_9270.rb', line 1227

def to_s
  return @string
end