Skip to content

Commit

Permalink
Simplify ULID#===
Browse files Browse the repository at this point in the history
Might be changed in #57 and ulid/spec#57
But this is enough for now
  • Loading branch information
kachick committed May 7, 2021
1 parent d39c089 commit b7e806a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/ulid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,9 @@ def eql?(other)
def ===(other)
case other
when ULID
self == other
to_i == other.to_i
when String
begin
self == self.class.parse(other)
rescue Exception
false
end
to_s == other.upcase
else
false
end
Expand Down

0 comments on commit b7e806a

Please sign in to comment.