Skip to content

Commit 54e2514

Browse files
committed
[#62] Separate positional and keyword arguments for Ruby 3.0
1 parent 443b4d9 commit 54e2514

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

lib/parse/api/users.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def update_user(id, body = {}, headers: {}, **opts)
8484
# @return [Parse::Response]
8585
def set_service_auth_data(id, service_name, auth_data, headers: {}, **opts)
8686
body = { authData: { service_name => auth_data } }
87-
update_user(id, body, opts)
87+
update_user(id, body, **opts)
8888
end
8989

9090
# Delete a {Parse::User} record given an objectId.
@@ -143,7 +143,7 @@ def logout(session_token, headers: {}, **opts)
143143
def signup(username, password, email = nil, body: {}, **opts)
144144
body = body.merge({ username: username, password: password })
145145
body[:email] = email || body[:email]
146-
create_user(body, opts)
146+
create_user(body, **opts)
147147
end
148148
end # Users
149149
end #API

lib/parse/model/associations/has_many.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def has_many(key, scope = nil, **opts)
406406
opts[:through] ||= :query
407407

408408
if opts[:through] == :query
409-
return has_many_queried(key, scope, opts)
409+
return has_many_queried(key, scope, **opts)
410410
end
411411

412412
# below this is the same

lib/parse/model/classes/session.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Session < Parse::Object
6868
# @param token [String] the session token
6969
# @return [Session] the session for this token, otherwise nil.
7070
def self.session(token, **opts)
71-
response = client.fetch_session(token, opts)
71+
response = client.fetch_session(token, **opts)
7272
if response.success?
7373
return Parse::Session.build response.result
7474
end

lib/parse/model/classes/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def self.session(token, opts = {})
417417
def self.session!(token, opts = {})
418418
# support Parse::Session objects
419419
token = token.session_token if token.respond_to?(:session_token)
420-
response = client.current_user(token, opts)
420+
response = client.current_user(token, **opts)
421421
response.success? ? Parse::User.build(response.result) : nil
422422
end
423423

lib/parse/model/core/fetching.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Fetching
1515
# @param opts [Hash] a set of options to pass to the client request.
1616
# @return [self] the current object, useful for chaining.
1717
def fetch!(opts = {})
18-
response = client.fetch_object(parse_class, id, opts)
18+
response = client.fetch_object(parse_class, id, **opts)
1919
if response.error?
2020
puts "[Fetch Error] #{response.code}: #{response.error}"
2121
end

lib/parse/query.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def distinct(field)
635635
compile_query[:distinct] = Query.format_field(field).to_sym
636636
@count = old_count_value
637637
# perform aggregation
638-
return client.aggregate_objects(@table, compile_query.as_json, _opts).result
638+
return client.aggregate_objects(@table, compile_query.as_json, **_opts).result
639639
else
640640
raise ArgumentError, "Invalid field name passed to `distinct`."
641641
end
@@ -654,7 +654,7 @@ def distinct(field)
654654
def count
655655
old_value = @count
656656
@count = 1
657-
res = client.find_objects(@table, compile.as_json, _opts).count
657+
res = client.find_objects(@table, compile.as_json, **_opts).count
658658
@count = old_value
659659
res
660660
end
@@ -766,7 +766,7 @@ def _opts
766766
# @param compiled_query [Hash] the compiled query
767767
# @return [Parse::Response] a response for a query request.
768768
def fetch!(compiled_query)
769-
response = client.find_objects(@table, compiled_query.as_json, _opts)
769+
response = client.find_objects(@table, compiled_query.as_json, **_opts)
770770
if response.error?
771771
puts "[ParseQuery] #{response.error}"
772772
end

0 commit comments

Comments
 (0)