Class: Yancya::BigQuery
- Inherits:
-
Object
- Object
- Yancya::BigQuery
- Defined in:
- lib/yancya/big_query.rb,
lib/yancya/big_query/job.rb,
lib/yancya/big_query/jobs.rb,
lib/yancya/big_query/table.rb,
lib/yancya/big_query/tables.rb,
lib/yancya/big_query/dataset.rb,
lib/yancya/big_query/project.rb,
lib/yancya/big_query/version.rb,
lib/yancya/big_query/datasets.rb,
lib/yancya/big_query/projects.rb,
lib/yancya/big_query/resource.rb,
lib/yancya/big_query/tabledata.rb
Defined Under Namespace
Classes: BQ, Dataset, Datasets, Job, Jobs, Project, Projects, Resource, Table, Tabledata, Tables
Constant Summary collapse
- VERSION =
"0.1.1"
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #datasets ⇒ Object
-
#initialize(key_path:, issuer:, application_name: "github.com/yancya/big_query", application_version: BigQuery::VERSION) ⇒ BigQuery
constructor
A new instance of BigQuery.
- #jobs ⇒ Object
- #projects ⇒ Object
- #tabledata(project_id:, dataset_id:, table_id:) ⇒ Object
- #tables ⇒ Object
Constructor Details
#initialize(key_path:, issuer:, application_name: "github.com/yancya/big_query", application_version: BigQuery::VERSION) ⇒ BigQuery
Returns a new instance of BigQuery.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/yancya/big_query.rb', line 20 def initialize(key_path:, issuer:, application_name: "github.com/yancya/big_query", application_version: BigQuery::VERSION) app_info = { application_name: application_name, application_version: application_version } client = Google::APIClient.new(app_info) asserter = Google::APIClient::JWTAsserter.new( issuer, "https://www.googleapis.com/auth/bigquery", Google::APIClient::PKCS12.load_key(File.open(key_path), "notasecret") ) client. = asserter. @bq = BQ.new(client) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
12 13 14 |
# File 'lib/yancya/big_query.rb', line 12 def client @client end |
Instance Method Details
#datasets ⇒ Object
43 44 45 |
# File 'lib/yancya/big_query.rb', line 43 def datasets Datasets.new(bq: @bq) end |
#projects ⇒ Object
51 52 53 |
# File 'lib/yancya/big_query.rb', line 51 def projects Projects.new(bq: @bq) end |