Class: AdzerkDecisionSdk::Client
- Inherits:
-
Object
- Object
- AdzerkDecisionSdk::Client
- Defined in:
- lib/adzerk_decision_sdk/client.rb
Instance Attribute Summary collapse
-
#decisions ⇒ Object
readonly
Returns the value of attribute decisions.
-
#pixels ⇒ Object
readonly
Returns the value of attribute pixels.
-
#user_db ⇒ Object
readonly
Returns the value of attribute user_db.
Instance Method Summary collapse
-
#initialize(network_id:, protocol: 'https', host: nil, path: nil, api_key: nil, user_agent: 'Adzerk Decision SDK', logger: nil, is_debug: false, site_id: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(network_id:, protocol: 'https', host: nil, path: nil, api_key: nil, user_agent: 'Adzerk Decision SDK', logger: nil, is_debug: false, site_id: nil) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/adzerk_decision_sdk/client.rb', line 13 def initialize(network_id:, protocol: 'https', host: nil, path: nil, api_key: nil, user_agent: 'Adzerk Decision SDK', logger: nil, is_debug: false, site_id: nil) version = Gem.loaded_specs['adzerk_decision_sdk'].version.to_s host ||= "e-#{network_id}.adzerk.net" configuration = Configuration.new configuration.scheme = protocol configuration.host = host configuration.api_key['ApiKeyAuth'] = api_key configuration.debugging = is_debug configuration.server_index = nil unless logger.nil? configuration.logger = logger end api_client = ApiClient.new(configuration) api_client.default_headers['X-Adzerk-Sdk-Version'] = "adzerk-decision-sdk-ruby:#{version}" if api_key api_client.default_headers['X-Adzerk-ApiKey'] = api_key end @decisions = DecisionClient.new(network_id, site_id, api_client, configuration.logger) @user_db = UserDbClient.new(network_id, api_client, configuration.logger) @pixels = PixelClient.new(api_client, configuration.logger) end |
Instance Attribute Details
#decisions ⇒ Object (readonly)
Returns the value of attribute decisions.
9 10 11 |
# File 'lib/adzerk_decision_sdk/client.rb', line 9 def decisions @decisions end |
#pixels ⇒ Object (readonly)
Returns the value of attribute pixels.
11 12 13 |
# File 'lib/adzerk_decision_sdk/client.rb', line 11 def pixels @pixels end |
#user_db ⇒ Object (readonly)
Returns the value of attribute user_db.
10 11 12 |
# File 'lib/adzerk_decision_sdk/client.rb', line 10 def user_db @user_db end |