title: How to create a new worksheet with Google Sheets API Ruby Client?
body: <p>I'm using the ruby client to update an existing spreadsheet range with the class Google::Apis::SheetsV4::SheetsService but can't find a way to create a new sheet. I want to create a new sheet for each new year. I want to test for the existence of a sheet within the spreadsheet by title and add a new sheet if it doesn't exist. I can't find any examples of ruby code which helps me to accomplish my task.</p>
  
  <p>This can not be a duplicate of the link proposed as a duplicate question as the ruby code in my answer below is very different to the solution written in C#. </p>
  
  <p><a href="http://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/SheetsV4/SheetsService" rel="nofollow noreferrer">http://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/SheetsV4/SheetsService</a></p>
  
  <p>Here is some of my code:</p>
  
  <pre><code>require 'google/apis/sheets_v4'
  </code></pre>
  
  <hr>
  
  <pre><code>SCOPE = Google::Apis::SheetsV4::AUTH_SPREADSHEETS
  </code></pre>
  
  <hr>
  
  <pre><code>spreadsheet_id = '1NTvP-VkDDE1_xzz_etc'
  </code></pre>
  
  <hr>