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.
1199 1200 1201 1202 1203 1204 |
# File 'lib/resolv.rb', line 1199 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
1205 1206 1207 |
# File 'lib/resolv.rb', line 1205 def downcase @downcase end |
#string ⇒ Object (readonly)
Returns the value of attribute string
1205 1206 1207 |
# File 'lib/resolv.rb', line 1205 def string @string end |
Instance Method Details
#==(other) ⇒ Object
1215 1216 1217 |
# File 'lib/resolv.rb', line 1215 def ==(other) return self.class == other.class && @downcase == other.downcase end |
#eql?(other) ⇒ Boolean
1219 1220 1221 |
# File 'lib/resolv.rb', line 1219 def eql?(other) return self == other end |
#hash ⇒ Object
1223 1224 1225 |
# File 'lib/resolv.rb', line 1223 def hash return @downcase.hash end |
#inspect ⇒ Object
1211 1212 1213 |
# File 'lib/resolv.rb', line 1211 def inspect return "#<#{self.class} #{self}>" end |
#to_s ⇒ Object
1207 1208 1209 |
# File 'lib/resolv.rb', line 1207 def to_s return @string end |