Class: Resolv::DNS::Label::Str
- Inherits:
-
Object
- Object
- Resolv::DNS::Label::Str
- Defined in:
- 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.
1246 1247 1248 1249 1250 1251 |
# File 'lib/resolv.rb', line 1246 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.
1252 1253 1254 |
# File 'lib/resolv.rb', line 1252 def downcase @downcase end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
1252 1253 1254 |
# File 'lib/resolv.rb', line 1252 def string @string end |
Instance Method Details
#==(other) ⇒ Object
1262 1263 1264 |
# File 'lib/resolv.rb', line 1262 def ==(other) return self.class == other.class && @downcase == other.downcase end |
#eql?(other) ⇒ Boolean
1266 1267 1268 |
# File 'lib/resolv.rb', line 1266 def eql?(other) return self == other end |
#hash ⇒ Object
1270 1271 1272 |
# File 'lib/resolv.rb', line 1270 def hash return @downcase.hash end |
#inspect ⇒ Object
1258 1259 1260 |
# File 'lib/resolv.rb', line 1258 def inspect return "#<#{self.class} #{self}>" end |
#to_s ⇒ Object
1254 1255 1256 |
# File 'lib/resolv.rb', line 1254 def to_s return @string end |