Method: Aspose::Cloud::Cells::Workbook#add_worksheet

Defined in:
lib/Cells/workbook.rb

#add_worksheet(worksheet_name = '') ⇒ Object



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/Cells/workbook.rb', line 376

def add_worksheet worksheet_name=''
  begin
    if @filename == ''
      raise 'Base file name not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + worksheet_name
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.put(signed_uri, '',:accept => 'application/json')
    json = JSON.parse(response)
    if json['Code']==201
      return true
    else
      return false
    end
  rescue Exception=>e
    print e
  end
end