Module: Datadog::Core::Configuration::Base::InstanceMethods
- Included in:
- Datadog::Core::Configuration::Base
- Defined in:
- lib/datadog/core/configuration/base.rb,
sig/datadog/core/configuration/base.rbs
Overview
Instance methods for configuration
Instance Method Summary collapse
- #configure(opts = {}) {|_self| ... } ⇒ void
-
#dig(*options) ⇒ Object
Retrieves a nested option from a list of symbols.
-
#initialize(options = {}) ⇒ InstanceMethods
A new instance of InstanceMethods.
- #reset! ⇒ void
- #to_h ⇒ Hash[Symbol, Object?]
Instance Method Details
#configure(opts = {}) {|_self| ... } ⇒ void
This method returns an undefined value.
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/datadog/core/configuration/base.rb', line 70 def configure(opts = {}) opts.each do |name, value| if respond_to?("#{name}=") send("#{name}=", value) elsif option_defined?(name) set_option(name, value) end end # Apply any additional settings from block yield(self) if block_given? end |
#dig(*options) ⇒ Object
Retrieves a nested option from a list of symbols
88 89 90 91 92 93 94 |
# File 'lib/datadog/core/configuration/base.rb', line 88 def dig(*) raise ArgumentError, 'expected at least one option' if .empty? .inject(self) do |receiver, option| receiver.send(option) end end |
#initialize(options = {}) ⇒ InstanceMethods
Returns a new instance of InstanceMethods.
66 67 68 |
# File 'lib/datadog/core/configuration/base.rb', line 66 def initialize( = {}) configure() unless .empty? end |
#reset! ⇒ void
This method returns an undefined value.
96 97 98 |
# File 'lib/datadog/core/configuration/base.rb', line 96 def reset! end |
#to_h ⇒ Hash[Symbol, Object?]
83 84 85 |
# File 'lib/datadog/core/configuration/base.rb', line 83 def to_h end |