Class: Bq::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bq.rb

Direct Known Subclasses

InstalledApp

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/bq.rb', line 12

def initialize(opts={})
  @project_id         = opts[:project_id]
  application_name    = opts[:application_name]    || "Bq"
  application_version = opts[:application_version] || "0.0.1"

  @client = Google::APIClient.new(
    :application_name    => application_name,
    :application_version => application_version
  )
  self.token = opts[:token] if opts[:token]
  @bq_client = @client.discovered_api('bigquery', 'v2')
end

Instance Attribute Details

#project_idObject

Returns the value of attribute project_id.



10
11
12
# File 'lib/bq.rb', line 10

def project_id
  @project_id
end

#tokenObject

Returns the value of attribute token.



9
10
11
# File 'lib/bq.rb', line 9

def token
  @token
end