Module: Soothsayer

Defined in:
lib/soothsayer.rb,
lib/soothsayer/version.rb,
lib/soothsayer/hosted_model.rb,
lib/soothsayer/trained_model.rb

Defined Under Namespace

Classes: API, Configuration, HostedModel, OAuthTokenError, TrainedModel

Constant Summary collapse

VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.config(config = Configuration.new) {|config| ... } ⇒ Object

Configures Soothsayer with the credentials downloaded by the Ruby api client into .google-api.yaml

config_file = File.expand_path('~/.google-api.yaml')
config = open(config_file, 'r'){ |file| YAML.load(file.read) }
Soothsayer.config do |c|
  c.client_id = config.client_id
  c.client_secret = config.client_secret
  c.access_token = config.access_token
  c.refresh_token = config.refresh_token
end

Yields:



24
25
26
27
# File 'lib/soothsayer.rb', line 24

def self.config(config = Configuration.new)
  yield config
  @@config = config
end

.credentialsObject



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

def self.credentials
  @@config
end