Module: BusinessInsightApiClient

Defined in:
lib/business_insight_api_client.rb,
lib/business_insight_api_client/mash.rb,
lib/business_insight_api_client/client.rb,
lib/business_insight_api_client/errors.rb,
lib/business_insight_api_client/helpers.rb,
lib/business_insight_api_client/version.rb,
lib/business_insight_api_client/api/groups.rb,
lib/business_insight_api_client/api/animals.rb,
lib/business_insight_api_client/api/calendars.rb,
lib/business_insight_api_client/api/applications.rb,
lib/business_insight_api_client/api/installations.rb,
lib/business_insight_api_client/helpers/restclient.rb,
lib/business_insight_api_client/helpers/authorization.rb

Overview

BusinessInsightApiClient configuration class This class allows to set a configuration uses in the whole application until reloaded.

Defined Under Namespace

Modules: Api, Errors, Helpers Classes: Client, Mash

Constant Summary collapse

VERSION =
'0.2.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_urlString

Returns the api url, default: api.nedap-bi.com.

Returns:



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

def api_url
  @api_url
end

.authorization_urlString

Returns the authorization url of the api, default: nedap-bi.com.

Returns:

  • (String)

    the authorization url of the api, default: nedap-bi.com



21
22
23
# File 'lib/business_insight_api_client.rb', line 21

def authorization_url
  @authorization_url
end

.client_idString

Returns [String] the client id uses in OAuth authorization.

Returns:

  • (String)
    String

    the client id uses in OAuth authorization



29
30
31
# File 'lib/business_insight_api_client.rb', line 29

def client_id
  @client_id
end

.client_secretString

Returns the client secret uses in OAuth authorization.

Returns:

  • (String)

    the client secret uses in OAuth authorization



33
34
35
# File 'lib/business_insight_api_client.rb', line 33

def client_secret
  @client_secret
end

.default_content_typeString

Returns the default content, default: application/json.

Returns:

  • (String)

    the default content, default: application/json



25
26
27
# File 'lib/business_insight_api_client.rb', line 25

def default_content_type
  @default_content_type
end

Class Method Details

.configure {|configuration| ... } ⇒ Boolean, true

Configures the business insight api for usage. This method expects an configuration block.

Examples:

BusinessInsightApiClient.configure do |conf|
  conf.client_id = 'someclientid'
end

Yields:

  • (configuration)

    the configuration class.

Yield Parameters:

  • api_url (String)
  • authorization_url (String)
  • default_content_type (String)
  • client_id (String)
  • client_secret (String)

Returns:

  • (Boolean, true)


48
49
50
51
# File 'lib/business_insight_api_client.rb', line 48

def configure
  yield self
  true
end