Skip to content

Commit 8f2c1b1

Browse files
RogersRogers
authored andcommitted
Clean up a bit more
1 parent 987eae9 commit 8f2c1b1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/zendesk_api/resource.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
require 'zendesk_api/association'
55
require 'zendesk_api/associations'
66
require 'zendesk_api/verbs'
7+
require 'byebug'
78

89
# See docs: https://developer.zendesk.com/api-reference/
910
module ZendeskAPI
@@ -135,15 +136,14 @@ def ==(other)
135136

136137
return true if other.object_id == object_id
137138

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}"
139+
return other.id && (other.id == id) if other.is_a?(Data)
144140

145-
false
141+
unless other.is_a?(Integer)
142+
return warn "Trying to compare #{other.class} to a Resource
143+
from #{caller.first}"
146144
end
145+
146+
id == other
147147
end
148148
alias :eql :==
149149

0 commit comments

Comments
 (0)