gimite/google-drive-ruby — pull request #123 by jakl (2014-12-09 00:01:10+00:00)
Title: Add worksheet_by_gid

Thanks so much for this gem. I added a new method, described below.

My example spreadsheet has a worksheet with a gid of 1836968288 - visible as a URL param:
https://docs.google.com/spreadsheets/d/1NfC3a5k0qsS5qxv10v2P88VzqFReyCi-rI8LIB4qvYg/edit#gid=1836968288

This gid also appears in link hrefs in the worksheets feed.
https://spreadsheets.google.com/feeds/worksheets/1NfC3a5k0qsS5qxv10v2P88VzqFReyCi-rI8LIB4qvYg/private/full
The css selector might look like:
entry link[href*="gid=1836968288"]

I've added support for getting this worksheet using:
session.spreadsheet_by_key('1NfC3a5k0qsS5qxv10v2P88VzqFReyCi-rI8LIB4qvYg').worksheet_by_gid(1836968288)

I thought this might be useful for others. (I've built a local gem to use it myself for now.)