Class: Resolv::DNS::Label::Str
- Inherits:
-
Object
- Object
- Resolv::DNS::Label::Str
- Defined in:
- lib/rubysl/resolv/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.
1171 1172 1173 1174 1175 1176 |
# File 'lib/rubysl/resolv/resolv.rb', line 1171 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.
1177 1178 1179 |
# File 'lib/rubysl/resolv/resolv.rb', line 1177 def downcase @downcase end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
1177 1178 1179 |
# File 'lib/rubysl/resolv/resolv.rb', line 1177 def string @string end |
Instance Method Details
#==(other) ⇒ Object
1187 1188 1189 |
# File 'lib/rubysl/resolv/resolv.rb', line 1187 def ==(other) return self.class == other.class && @downcase == other.downcase end |
#eql?(other) ⇒ Boolean
1191 1192 1193 |
# File 'lib/rubysl/resolv/resolv.rb', line 1191 def eql?(other) return self == other end |
#hash ⇒ Object
1195 1196 1197 |
# File 'lib/rubysl/resolv/resolv.rb', line 1195 def hash return @downcase.hash end |
#inspect ⇒ Object
1183 1184 1185 |
# File 'lib/rubysl/resolv/resolv.rb', line 1183 def inspect return "#<#{self.class} #{self}>" end |
#to_s ⇒ Object
1179 1180 1181 |
# File 'lib/rubysl/resolv/resolv.rb', line 1179 def to_s return @string end |