Class: Operto::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/operto/config.rb,
sig/operto.rbs

Overview

Injected by the host app (see the Operto.configure initializer): the API credentials, a cache, and a token store. Keeping these out of the gem is what makes it host-agnostic.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



8
9
10
11
# File 'lib/operto/config.rb', line 8

def initialize
  @base_url = 'https://teams-api.operto.com/api/v1/'.freeze
  @token_store = MemoryTokenStore.new
end

Instance Attribute Details

#base_url::String

Returns the value of attribute base_url.

Returns:

  • (::String)


6
7
8
# File 'lib/operto/config.rb', line 6

def base_url
  @base_url
end

#client_id::String?

Returns the value of attribute client_id.

Returns:

  • (::String, nil)


6
7
8
# File 'lib/operto/config.rb', line 6

def client_id
  @client_id
end

#secret::String?

Returns the value of attribute secret.

Returns:

  • (::String, nil)


6
7
8
# File 'lib/operto/config.rb', line 6

def secret
  @secret
end

#token_storeObject

Duck-typed: the host may inject its own store (see MemoryTokenStore).

Returns:

  • (Object)


22
23
24
# File 'sig/operto.rbs', line 22

def token_store
  @token_store
end