Module: IBM::ML

Included in:
Cloud, Local, Zos
Defined in:
lib/ibm/ml.rb,
lib/ibm/ml/zos.rb,
lib/ibm/ml/cloud.rb,
lib/ibm/ml/local.rb,
lib/ibm/ml/version.rb

Overview

Module for calling a Machine Learning service

Defined Under Namespace

Classes: Cloud, Local, QueryError, ScoringError, Zos

Constant Summary collapse

VERSION =
'0.2.1'.freeze

Instance Method Summary collapse

Instance Method Details

#fetch_tokenObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/ibm/ml.rb', line 20

def fetch_token
  uri          = URI.parse ldap_url
  http         = Net::HTTP.new uri.host, uri.port
  http.use_ssl = uri.scheme == 'https'

  response = http.request ldap_request(http, uri)

  raise response.class.to_s if response.is_a? Net::HTTPClientError
  process_ldap_response(response)
end

#initialize(username, password) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/ibm/ml.rb', line 12

def initialize(username, password)
  @username     = username
  @password     = password
  uri           = URI("https://#{@host}")
  @http         = Net::HTTP.new(uri.host, uri.port)
  @http.use_ssl = uri.scheme == 'https'
end