Sha256: bc7361ab84b851131e0736eed860583022be9feaa4076405cf0de16c17a3300e

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

module GSheets
  module V4
    class Session
      def initialize(access_token:, service: Google::Apis::SheetsV4::SheetsService.new)
        @access_token = access_token
        @service = service
        @service.authorization = access_token
      end

      def get_sheets_from_spreadsheet(id)
        service.get_spreadsheet(id).sheets
      end

      def append_row_to_spreadsheet(id:, row:, sheet_name:)
        service.append_spreadsheet_value(
          id,
          sheet_name,
          {"values": [row]},
          value_input_option: "RAW"
        )
      end

      def service
        @service
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
g_sheets-0.2.0 lib/g_sheets/v4/session.rb