Skip to content

Commit 3304e4c

Browse files
committed
fix minor doc/lint issues
1 parent 6e4f740 commit 3304e4c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Style/SafeNavigation:
3838
# SerpApiClient constructor is rated to 9
3939
# def initialize(params = {})
4040
Metrics/CyclomaticComplexity:
41-
Max: 10
41+
Max: 12
4242

4343
AllCops:
4444
NewCops: enable

lib/serpapi/client.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class Client
5353
# faster). [default: true]
5454
# * `async`: [Boolean] Support non-blocking job submission. [default: false]
5555
# * `timeout`: [Integer] HTTP get max timeout in seconds [default: 120s == 2m]
56+
# * `symbolize_names`: [Boolean] Convert JSON keys to symbols. [default: true]
5657
#
5758
# **Key:**kr
5859
#
@@ -134,7 +135,7 @@ def location(params = {})
134135
end
135136

136137
# Retrieve search result from the Search Archive API
137-
#
138+
#
138139
# ```ruby
139140
# client = SerpApi::Client.new(engine: 'google', api_key: ENV['SERPAPI_KEY'])
140141
# results = client.search(q: 'Coffee', location: 'Portland')
@@ -191,9 +192,7 @@ def query(params)
191192
q = @params.clone.merge(params)
192193

193194
# do not pollute default params with custom params
194-
if q.key?(:symbolize_names)
195-
q.delete(:symbolize_names)
196-
end
195+
q.delete(:symbolize_names) if q.key?(:symbolize_names)
197196

198197
# delete empty key/value
199198
q.compact
@@ -209,7 +208,6 @@ def persistent?
209208
# @param [String] endpoint HTTP service URI
210209
# @param [Symbol] decoder type :json or :html
211210
# @param [Hash] params custom search inputs
212-
# @param [Boolean] symbolize_names if true, convert JSON keys to symbols more memory efficient.
213211
# @return [String|Hash] raw HTML or decoded response as JSON / Hash
214212
def get(endpoint, decoder = :json, params = {})
215213
# execute get via open socket

0 commit comments

Comments
 (0)