Class: GoogleDrive::Spreadsheet

Inherits:
Object
  • Object
show all
Defined in:
lib/model_to_googlesheet/google_drive/spreadsheet.rb

Instance Method Summary collapse

Instance Method Details

#create_or_recreate_ws(title) ⇒ Object

to delete everything in the worksheet, deleting row by row is too slow



10
11
12
13
14
15
# File 'lib/model_to_googlesheet/google_drive/spreadsheet.rb', line 10

def create_or_recreate_ws title
	if ws = worksheet_by_title(title) 
		ws.delete
	end
	add_worksheet title
end

#get_or_create_ws(title) ⇒ Object



4
5
6
7
# File 'lib/model_to_googlesheet/google_drive/spreadsheet.rb', line 4

def get_or_create_ws title
	ws = worksheet_by_title title 
	ws ||= add_worksheet(title)
end