Skip to content

Commit 513a23f

Browse files
committed
Lint fix
1 parent aaa7819 commit 513a23f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/typesense/api_call.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def perform_request(method, endpoint, query_parameters: nil, body_parameters: ni
8585
req.body = body
8686
end
8787
end
88-
set_node_healthcheck(node, is_healthy: true) if response.status >= 1 && response.status <= 499
88+
set_node_healthcheck(node, is_healthy: true) if response.status.between?(1, 499)
8989

9090
@logger.debug "Request #{method}:#{uri_for(endpoint, node)} to Node #{node[:index]} was successfully made (at the network layer). response.status was #{response.status}."
9191

@@ -96,7 +96,7 @@ def perform_request(method, endpoint, query_parameters: nil, body_parameters: ni
9696
end
9797

9898
# If response is 2xx return the object, else raise the response as an exception
99-
return parsed_response if response.status >= 200 && response.status <= 299
99+
return parsed_response if response.status.between?(200, 299)
100100

101101
exception_message = (parsed_response && parsed_response['message']) || 'Error'
102102
raise custom_exception_klass_for(response), exception_message
@@ -190,7 +190,7 @@ def custom_exception_klass_for(response)
190190
Typesense::Error::ObjectAlreadyExists.new(response: response)
191191
elsif response.status == 422
192192
Typesense::Error::ObjectUnprocessable.new(response: response)
193-
elsif response.status >= 500 && response.status <= 599
193+
elsif response.status.between?(500, 599)
194194
Typesense::Error::ServerError.new(response: response)
195195
elsif response.respond_to?(:timed_out?) && response.timed_out?
196196
Typesense::Error::TimeoutError.new(response: response)

0 commit comments

Comments
 (0)