Class: Gem::Resolv::DNS::Label::Str
- Inherits:
-
Object
- Object
- Gem::Resolv::DNS::Label::Str
- Defined in:
- lib/rubygems/vendor/resolv/lib/resolv.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#downcase ⇒ Object
readonly
Returns the value of attribute downcase.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(string) ⇒ Str
constructor
A new instance of Str.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(string) ⇒ Str
Returns a new instance of Str.
1221 1222 1223 1224 1225 1226 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1221 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
#downcase ⇒ Object (readonly)
Returns the value of attribute downcase.
1227 1228 1229 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1227 def downcase @downcase end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
1227 1228 1229 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1227 def string @string end |
Instance Method Details
#==(other) ⇒ Object
1237 1238 1239 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1237 def ==(other) return self.class == other.class && @downcase == other.downcase end |
#eql?(other) ⇒ Boolean
1241 1242 1243 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1241 def eql?(other) return self == other end |
#hash ⇒ Object
1245 1246 1247 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1245 def hash return @downcase.hash end |
#inspect ⇒ Object
1233 1234 1235 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1233 def inspect return "#<#{self.class} #{self}>" end |
#to_s ⇒ Object
1229 1230 1231 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1229 def to_s return @string end |