Class: DatadogExporter::Configuration
- Inherits:
-
Object
- Object
- DatadogExporter::Configuration
- Defined in:
- lib/datadog_exporter/configuration.rb
Overview
The global configuration of the DatadogExporter client.
Constant Summary collapse
- DEFAULT_ORG_CONFIG_FILENAME =
"organizations_config.yml".freeze
Class Method Summary collapse
-
.add_setting(name, default) ⇒ Object
Create a getter and a setter for a setting.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 |
# File 'lib/datadog_exporter/configuration.rb', line 9 def initialize @config = {} end |
Class Method Details
.add_setting(name, default) ⇒ Object
Create a getter and a setter for a setting.
If the default value is a Proc, it will be called on initialize.
20 21 22 23 24 25 26 27 28 |
# File 'lib/datadog_exporter/configuration.rb', line 20 def self.add_setting(name, default) define_method name do @config[name] ||= default.is_a?(Proc) ? default.call : default end define_method :"#{name}=" do |value| @config[name] = value end end |