nice_enum 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/lib/nice_enum.rb +6 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -38,7 +38,7 @@ different to_s method. Otherwise the classes are functionally identical.
|
|
38
38
|
Of course, an enum can use anything as it's value type, not only integers.
|
39
39
|
The value type must only provide a <=> operator.
|
40
40
|
|
41
|
-
Up-To-Date documentation is avaiable {at rubydoc.info}[http://rubydoc.info/github/raphaelr/
|
41
|
+
Up-To-Date documentation is avaiable {at rubydoc.info}[http://rubydoc.info/github/raphaelr/nice_enum/master/frames].
|
42
42
|
|
43
43
|
= Installation
|
44
44
|
|
data/lib/nice_enum.rb
CHANGED
@@ -45,6 +45,12 @@ class Enum
|
|
45
45
|
return value <=> other
|
46
46
|
end
|
47
47
|
|
48
|
+
# Returns whether the value of +self+ and the value of +other+ are equal.
|
49
|
+
def eql?(other)
|
50
|
+
other = other.value if other.is_a? self.class
|
51
|
+
return value.eql?(other)
|
52
|
+
end
|
53
|
+
|
48
54
|
# Returns the hashcode of +value+.
|
49
55
|
def hash
|
50
56
|
value.hash
|