Skip to content

Commit 789b731

Browse files
committed
fix: rubythecherry
1 parent fea1cae commit 789b731

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

templates/ruby/search_helpers.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ end
4848
# @param timeout [Proc] the function to decide how long to wait between retries.
4949
# @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
5050
# @return [Http::Response] the last get_api_key response
51-
def wait_for_api_key(key, operation, api_key = {}, max_retries = 50, timeout = -> (retry_count) { [retry_count * 200, 5000].min }, request_options = {})
51+
def wait_for_api_key(key, operation, api_key = Search::ApiKey.new, max_retries = 50, timeout = -> (retry_count) { [retry_count * 200, 5000].min }, request_options = {})
52+
api_key = api_client.object_to_hash(api_key)
53+
5254
retries = 0
5355
if operation == 'update'
5456
raise ArgumentError, '`api_key` is required when waiting for an `update` operation.' if api_key.nil?
5557
while retries < max_retries
5658
updated_key = get_api_key(key, request_options)
5759
updated_key_hash = updated_key.to_hash
5860
equals = true
59-
api_key.to_hash.each do |k, v|
61+
api_key.each do |k, v|
6062
equals &&= updated_key_hash[k] == v
6163
end
6264

0 commit comments

Comments
 (0)