Class: ClassLink::Client

Inherits:
Object
  • Object
show all
Includes:
Interface
Defined in:
lib/classlink_client/client.rb

Constant Summary collapse

DIRECT_OPTIONS =
%i(client_id client_secret endpoint)
PROXY_OPTIONS =
%i(access_token app_id)

Constants included from Interface

Interface::METHOD_NAME_PROXY, Interface::RESOURCES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RequestSigning

#request

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.



19
20
21
22
23
24
25
26
# File 'lib/classlink_client/client.rb', line 19

def initialize(options)
  handle_options!(options)

  # if an endpoint hasn't been supplied, then we're using the proxy
  @proxy_api = !endpoint
  @base_url = endpoint || "https://oneroster-proxy.classlink.io/#{app_id}"
  @base_url << "/ims/oneroster/v1p1/"
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



17
18
19
# File 'lib/classlink_client/client.rb', line 17

def base_url
  @base_url
end

#proxy_apiObject (readonly)

Returns the value of attribute proxy_api.



17
18
19
# File 'lib/classlink_client/client.rb', line 17

def proxy_api
  @proxy_api
end