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.
67 68 69 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 67 def initialize @options = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
65 66 67 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 65 def @options end |
Class Method Details
.add_getter!(option) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 77 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
71 72 73 74 75 |
# File 'lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb', line 71 def self.add_setter!(option) define_method(option) do |value| @options[option.to_s[0...-1].to_sym] = value end end |