Skip to content

Commit 5bcf75d

Browse files
authored
Use instance_variable_defined? to avoid warning
This avoids Ruby complaining that we're referencing the @Paginator instance variable which may not be defined at this point.
1 parent 289716e commit 5bcf75d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/api-pagination/configuration.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ def initialize
5050
end
5151

5252
def paginator
53-
@paginator || set_paginator
53+
if instance_variable_defined? :@paginator
54+
@paginator
55+
else
56+
set_paginator
57+
end
5458
end
5559

5660
def paginator=(paginator)

0 commit comments

Comments
 (0)