Skip to content

Keyword arguments are deprecated in Ruby 2.7 and are obsolete from Ruby 3.0 #11

Description

@y-bonfire

https://github.com/googleapis/google-api-ruby-client/blob/316ac7512fd54a1fc105f2d752797784cf926097/generated/google-apis-drive_v3/lib/google/apis/drive_v3/service.rb#L1352

        def get_file(file_id, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
          if download_dest.nil?
            command = make_simple_command(:get, 'files/{fileId}', options)

The following methods have keyword arguments:
Google::Apis::DriveV3::DriveService#get_file

Keyword arguments are deprecated in Ruby 2.7 (a warning is displayed), and are obsolete from Ruby 3.0.

def foo(key: 42); end; foo({key: 42})   # warned
def foo(**kw);    end; foo({key: 42})   # warned
def foo(key: 42); end; foo(**{key: 42}) # OK
def foo(**kw);    end; foo(**{key: 42}) # OK

When branching is included

if RUBY_VERSION >= "2.7"
  service.get_file(id, **params)
else
  service.get_file(id, params)
end

Depends on the Ruby version your project supports

https://www.ruby-lang.org/ja/news/2019/12/25/ruby-2-7-0-released/
gimite#439
gimite#410

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions