lib/zendesk2/paged_collection.rb in zendesk2-1.11.0 vs lib/zendesk2/paged_collection.rb in zendesk2-1.12.0
- old
+ new
@@ -56,22 +56,22 @@
page = page.next_page
end
end
def next_page
- if next_page_link
- options = { 'url' => next_page_link }
- options['filtered'] = filtered if respond_to?(:filtered) # searchable
- new_page.all(options)
- end
+ return nil unless next_page_link
+
+ options = { 'url' => next_page_link }
+ options['filtered'] = filtered if respond_to?(:filtered) # searchable
+ new_page.all(options)
end
def previous_page
- if previous_page_link
- options = { 'url' => previous_page_link }
- options['filtered'] = filtered if respond_to?(:filtered) # searchable
- new_page.all(options)
- end
+ return nil unless previous_page_link
+
+ options = { 'url' => previous_page_link }
+ options['filtered'] = filtered if respond_to?(:filtered) # searchable
+ new_page.all(options)
end
# Attempt creation of resource and explode if unsuccessful
#
# @raise [Zendesk2::Error] if creation was unsuccessful