Skip to content

Commit 24e38b1

Browse files
committed
Merge pull request zendesk#288 from zendesk/roman/deprecation
Fix a deprecation warning
2 parents d22208a + ce6eca2 commit 24e38b1

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ rvm:
55
- 2.0.0
66
- 2.1
77
- 2.2
8+
- 2.3.0
89
- jruby
910

1011
sudo: false

lib/zendesk_api/collection.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,17 +282,19 @@ def clear_cache
282282
end
283283

284284
# @private
285-
def to_ary; nil; end
285+
def to_ary
286+
nil
287+
end
286288

287-
def respond_to?(name)
288-
super || Array.new.respond_to?(name)
289+
def respond_to_missing?(name, include_all)
290+
[].respond_to?(name, include_all)
289291
end
290292

291293
# Sends methods to underlying array of resources.
292294
def method_missing(name, *args, &block)
293295
if resource_methods.include?(name)
294296
collection_method(name, *args, &block)
295-
elsif Array.new.respond_to?(name)
297+
elsif [].respond_to?(name, false)
296298
array_method(name, *args, &block)
297299
else
298300
next_collection(name, *args, &block)
@@ -452,7 +454,7 @@ def with_association?
452454
## Method missing
453455

454456
def array_method(name, *args, &block)
455-
to_a.send(name, *args, &block)
457+
to_a.public_send(name, *args, &block)
456458
end
457459

458460
def next_collection(name, *args, &block)

0 commit comments

Comments
 (0)