Class: Gslide::Models::SpreadsheetDraft
Instance Method Summary
collapse
#get_request, #post_request
Constructor Details
65
66
67
|
# File 'lib/gslide/models/spreadsheet.rb', line 65
def initialize(auth: nil)
@auth = auth
end
|
Instance Method Details
#create(options = {}) ⇒ Object
69
70
71
72
73
74
75
76
77
|
# File 'lib/gslide/models/spreadsheet.rb', line 69
def create(options = {})
request_body = options.convert_keys { |k| k.to_s.lower_camel_case }.to_json
uri = URI(GOOGLE_SHEETS)
response_body = post_request(uri, auth_token: @auth.token, body: request_body)
spreadsheet_id = response_body["spreadsheetId"]
Spreadsheet.new(spreadsheet_id, auth: @auth)
end
|