Module: Google::Area120::Tables

Defined in:
lib/google/area120/tables.rb,
lib/google/area120/tables/version.rb

Constant Summary collapse

VERSION =
"0.2.2"

Class Method Summary collapse

Class Method Details

.tables_service(version: :v1alpha1, &block) ⇒ TablesService::Client

Create a new client object for TablesService.

By default, this returns an instance of Google::Area120::Tables::V1alpha1::TablesService::Client for version V1alpha1 of the API. However, you can specify specify a different API version by passing it in the version parameter. If the TablesService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned.

About TablesService

The Tables Service provides an API for reading and updating tables. It defines the following resource model:

  • The API has a collection of Table resources, named tables/*

  • Each Table has a collection of Row resources, named tables/*/rows/*

  • The API has a collection of Workspace resources, named workspaces/*.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1alpha1)

    The API version to connect to. Optional. Defaults to :v1alpha1.

Returns:

  • (TablesService::Client)

    A client object for the specified version.



60
61
62
63
64
65
66
67
68
69
# File 'lib/google/area120/tables.rb', line 60

def self.tables_service version: :v1alpha1, &block
  require "google/area120/tables/#{version.to_s.downcase}"

  package_name = Google::Area120::Tables
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  package_module = Google::Area120::Tables.const_get package_name
  package_module.const_get(:TablesService).const_get(:Client).new(&block)
end