Class: ClientConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/client_config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint: nil, environment: nil, application: nil, api_key: nil) ⇒ ClientConfig

Returns a new instance of ClientConfig.



21
22
23
24
25
26
# File 'lib/client_config.rb', line 21

def initialize(endpoint: nil, environment: nil, application: nil, api_key: nil)
  @endpoint = endpoint
  @environment = environment
  @application = application
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



4
5
6
# File 'lib/client_config.rb', line 4

def api_key
  @api_key
end

#applicationObject

Returns the value of attribute application.



4
5
6
# File 'lib/client_config.rb', line 4

def application
  @application
end

#deserializerObject

Returns the value of attribute deserializer.



4
5
6
# File 'lib/client_config.rb', line 4

def deserializer
  @deserializer
end

#endpointObject

Returns the value of attribute endpoint.



4
5
6
# File 'lib/client_config.rb', line 4

def endpoint
  @endpoint
end

#environmentObject

Returns the value of attribute environment.



4
5
6
# File 'lib/client_config.rb', line 4

def environment
  @environment
end

#executorObject

Returns the value of attribute executor.



4
5
6
# File 'lib/client_config.rb', line 4

def executor
  @executor
end

#serializerObject

Returns the value of attribute serializer.



4
5
6
# File 'lib/client_config.rb', line 4

def serializer
  @serializer
end

Class Method Details

.createObject



7
8
9
# File 'lib/client_config.rb', line 7

def self.create
  ClientConfig.new
end

.create_from_properties(properties, prefix) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/client_config.rb', line 11

def self.create_from_properties(properties, prefix)
  properties = properties.transform_keys(&:to_sym)
  client_config = create
  client_config.endpoint = properties["#{prefix}endpoint".to_sym]
  client_config.environment = properties["#{prefix}environment".to_sym]
  client_config.application = properties["#{prefix}application".to_sym]
  client_config.api_key = properties["#{prefix}apikey".to_sym]
  client_config
end

Instance Method Details

#context_data_deserializerObject



28
29
30
# File 'lib/client_config.rb', line 28

def context_data_deserializer
  @deserializer
end

#context_data_deserializer=(deserializer) ⇒ Object



32
33
34
# File 'lib/client_config.rb', line 32

def context_data_deserializer=(deserializer)
  @deserializer = deserializer
end

#context_event_serializerObject



36
37
38
# File 'lib/client_config.rb', line 36

def context_event_serializer
  @serializer
end

#context_event_serializer=(serializer) ⇒ Object



40
41
42
# File 'lib/client_config.rb', line 40

def context_event_serializer=(serializer)
  @serializer = serializer
end