lib/phlex/sgml/safe_value.rb
Lines
100%11 of 11 covered
Branches
—0 of 0 covered
Methods
100%4 of 4 covered
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 1 | class Phlex::SGML::SafeValue |
| 4 | 1 | include Phlex::SGML::SafeObject |
| 5 | ||
| 6 | 1 | def initialize(to_s) |
| 7 | 1267 | @to_s = to_s |
| 8 | end | |
| 9 | ||
| 10 | 1 | attr_reader :to_s |
| 11 | ||
| 12 | 1 | def ==(other) |
| 13 | 2 | self.class == other.class && @to_s == other.to_s |
| 14 | end | |
| 15 | ||
| 16 | 1 | def eql?(other) |
| 17 | 6 | self.class == other.class && @to_s.eql?(other.to_s) |
| 18 | end | |
| 19 | ||
| 20 | 1 | def hash |
| 21 | 186 | [self.class, @to_s].hash |
| 22 | end | |
| 23 | end |