Skip to content

Commit 2f05515

Browse files
RogersRogers
authored andcommitted
Clean up a bit more
1 parent 987eae9 commit 2f05515

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/zendesk_api/resource.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,14 @@ def ==(other)
135135

136136
return true if other.object_id == object_id
137137

138-
if other.is_a?(Data)
139-
other.id && other.id == id
140-
elsif other.is_a?(Integer)
141-
id == other
142-
else
143-
warn "Trying to compare #{other.class} to a Resource from #{caller.first}"
144-
145-
false
138+
return other.id && (other.id == id) if other.is_a?(Data)
139+
140+
unless other.is_a?(Integer)
141+
return warn "Trying to compare #{other.class} to a Resource
142+
from #{caller.first}"
146143
end
144+
145+
id == other
147146
end
148147
alias :eql :==
149148

0 commit comments

Comments
 (0)