Class: GoogleBigquery::Client
- Inherits:
-
Object
- Object
- GoogleBigquery::Client
- Defined in:
- lib/google_bigquery/client.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#client ⇒ Object
Returns the value of attribute client.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #defaults_options(opts) ⇒ Object
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
- #parse_response(res) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/google_bigquery/client.rb', line 6 def initialize(opts = {}) @api ||= GoogleBigquery::Auth.api @client ||= GoogleBigquery::Auth.client #@auth.authorize # check expiration and cache ? self.tap do |client| client. ||= {} client.(opts) client. ||= opts yield client if block_given? end end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
4 5 6 |
# File 'lib/google_bigquery/client.rb', line 4 def api @api end |
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/google_bigquery/client.rb', line 4 def client @client end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/google_bigquery/client.rb', line 4 def end |
Class Method Details
.parse_response(res) ⇒ Object
28 29 30 31 |
# File 'lib/google_bigquery/client.rb', line 28 def self.parse_response(res) raise_detected_errors(res) JSON.parse(res.body) end |
Instance Method Details
#defaults_options(opts) ⇒ Object
20 21 22 |
# File 'lib/google_bigquery/client.rb', line 20 def (opts) end |
#parse_response(res) ⇒ Object
24 25 26 |
# File 'lib/google_bigquery/client.rb', line 24 def parse_response(res) JSON.parse(res.body) end |