Method: GoogleDrive::Session#collection_by_id

Defined in:
lib/google_drive/session.rb

#collection_by_id(id) ⇒ Object Also known as: folder_by_id

Returns GoogleDrive::Collection with given id.

e.g.

# https://drive.google.com/drive/folders/1rPPuzAew4tO3ORc88Vz1JscPCcnrX7-J
session.collection_by_id("1rPPuzAew4tO3ORc88Vz1JscPCcnrX7-J")


466
467
468
469
470
471
472
473
474
475
# File 'lib/google_drive/session.rb', line 466

def collection_by_id(id)
  file = file_by_id(id)
  unless file.is_a?(Collection)
    raise(
      GoogleDrive::Error,
      format('The file with the ID is not a folder: %s', id)
    )
  end
  file
end