Class: Datadog::Tracing::Contrib::GRPC::DatadogInterceptor::Base::PinAdapter
- Inherits:
-
Object
- Object
- Datadog::Tracing::Contrib::GRPC::DatadogInterceptor::Base::PinAdapter
- Defined in:
- lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb
Overview
Allows interceptors to define settings using methods instead of ‘[]`
Constant Summary collapse
- OPTIONS =
Configuration::Settings.instance_methods(false).freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ PinAdapter
constructor
A new instance of PinAdapter.
Constructor Details
#initialize ⇒ PinAdapter
Returns a new instance of PinAdapter.
73 74 75 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 73 def initialize @options = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
71 72 73 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 71 def @options end |
Class Method Details
.add_getter!(option) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 83 def self.add_getter!(option) define_method(option) do return @options[option] if @options.key?(option) Datadog.configuration.tracing[:grpc][option] end end |
.add_setter!(option) ⇒ Object
77 78 79 80 81 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 77 def self.add_setter!(option) define_method(option) do |value| @options[option.to_s[0...-1].to_sym] = value end end |