module OpenSTF::Client

Attributes

service[RW]

Public Class Methods

init(host:, token:) click to toggle source
# File lib/openstf/client.rb, line 10
def self.init(host:, token:)
  authentication_middleware_stack =
      [[
          Faraday::Request::TokenAuthentication,
          token
      ]]
  @service = Svelte::Service.create(
      url: "http://#{host}/api/v1/swagger.json",
      module_name: 'Internal',
      options: { middleware_stack: authentication_middleware_stack,
                 host: host}
  )
  self.module_eval("include #{@service}")
  return Service.new(@service)
end