@@ -105,7 +105,7 @@ def query_string(term:, page: 1, filters: [])
105105 end
106106
107107 # Recursive method that can handle multiple ROR result pages if necessary
108- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
108+ # rubocop:disable Metrics/AbcSize
109109 def process_pages ( term :, json :, filters : [ ] )
110110 return [ ] if json . blank?
111111
@@ -117,7 +117,7 @@ def process_pages(term:, json:, filters: [])
117117 return results unless pages > 1
118118
119119 # Gather the results from the additional page (only up to the max)
120- ( 2 ..( pages > max_pages ? max_pages : pages ) ) . each do |page |
120+ ( 2 ..( [ pages , max_pages ] . min ) ) . each do |page |
121121 json = query_ror ( term : term , page : page , filters : filters )
122122 results += parse_results ( json : json )
123123 end
@@ -129,7 +129,7 @@ def process_pages(term:, json:, filters: [])
129129 log_error ( method : 'ROR search' , error : e )
130130 results || [ ]
131131 end
132- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
132+ # rubocop:enable Metrics/AbcSize
133133
134134 # Convert the JSON items into a hash
135135 # rubocop:disable Metrics/AbcSize
0 commit comments