64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/to_google_spreadsheet.rb', line 64
def to_google_spreadsheet(worksheet, spreadsheet = nil)
spreadsheet = GoogleSpreadsheet::Config.default_spreadsheet unless spreadsheet
session = GoogleSpreadsheet.login(GoogleSpreadsheet::Config.email,
GoogleSpreadsheet::Config.password)
spreadsheet = session.spreadsheet_by_key(spreadsheet)
ws = spreadsheet.find_or_create_worksheet_by_name(worksheet)
ws.set_header_columns(self.first)
ws.populate(self)
ws.save
end
|