Class: ClientConfig
- Inherits:
-
Object
- Object
- ClientConfig
- Defined in:
- lib/client_config.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#application ⇒ Object
Returns the value of attribute application.
-
#deserializer ⇒ Object
Returns the value of attribute deserializer.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#executor ⇒ Object
Returns the value of attribute executor.
-
#serializer ⇒ Object
Returns the value of attribute serializer.
Class Method Summary collapse
Instance Method Summary collapse
- #context_data_deserializer ⇒ Object
- #context_data_deserializer=(deserializer) ⇒ Object
- #context_event_serializer ⇒ Object
- #context_event_serializer=(serializer) ⇒ Object
-
#initialize(endpoint: nil, environment: nil, application: nil, api_key: nil) ⇒ ClientConfig
constructor
A new instance of ClientConfig.
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_key ⇒ Object
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/client_config.rb', line 4 def api_key @api_key end |
#application ⇒ Object
Returns the value of attribute application.
4 5 6 |
# File 'lib/client_config.rb', line 4 def application @application end |
#deserializer ⇒ Object
Returns the value of attribute deserializer.
4 5 6 |
# File 'lib/client_config.rb', line 4 def deserializer @deserializer end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
4 5 6 |
# File 'lib/client_config.rb', line 4 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
4 5 6 |
# File 'lib/client_config.rb', line 4 def environment @environment end |
#executor ⇒ Object
Returns the value of attribute executor.
4 5 6 |
# File 'lib/client_config.rb', line 4 def executor @executor end |
#serializer ⇒ Object
Returns the value of attribute serializer.
4 5 6 |
# File 'lib/client_config.rb', line 4 def serializer @serializer end |
Class Method Details
.create ⇒ Object
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_deserializer ⇒ Object
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_serializer ⇒ Object
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 |