Commit 27a99b36 by minad

allow mimemagic objects to be used as hash keys

parent 68360f8d
...@@ -91,10 +91,16 @@ class MimeMagic ...@@ -91,10 +91,16 @@ class MimeMagic
end end
# Allow comparison with string # Allow comparison with string
def ==(x) def eql?(other)
type == x.to_s type == other.to_s
end end
def hash
type.hash
end
alias == eql?
private private
def self.child?(child, parent) def self.child?(child, parent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment