Class: Lightcast::Client

Inherits:
Object
  • Object
show all
Includes:
Authentication
Defined in:
lib/lightcast-ruby/client.rb

Constant Summary collapse

BASE_URL_AUTH =
'https://auth.emsicloud.com'
BASE_URL_SERVICES =
'https://classification.emsicloud.com'

Instance Method Summary collapse

Methods included from Authentication

#authenticate

Constructor Details

#initialize(client_id:, client_secret:, scope:) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
17
18
# File 'lib/lightcast-ruby/client.rb', line 12

def initialize(client_id:, client_secret:, scope:)
  @client_id      = client_id
  @client_secret  = client_secret
  @scope          = scope

  @skills = nil
end

Instance Method Details

#connection_authObject



20
21
22
# File 'lib/lightcast-ruby/client.rb', line 20

def connection_auth
  Connection.new(url: BASE_URL_AUTH, scope: @scope)
end

#connection_servicesObject



24
25
26
# File 'lib/lightcast-ruby/client.rb', line 24

def connection_services
  Connection.new(access_token: @access_token, url: BASE_URL_SERVICES)
end

#skills(version: '9.0.0', release: '2024.7') ⇒ Object



28
29
30
# File 'lib/lightcast-ruby/client.rb', line 28

def skills(version: '9.0.0', release: '2024.7')
  @skills ||= Lightcast::Services::Skills.new(client: self, version: version, release: release)
end