Class: TraceViz::Context::ConfigContext
- Inherits:
-
BaseContext
- Object
- BaseContext
- TraceViz::Context::ConfigContext
- Defined in:
- lib/trace_viz/context/config_context.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Attributes inherited from BaseContext
Instance Method Summary collapse
-
#apply_options(options) ⇒ Object
Apply the overrides from options.
-
#initialize(**options) ⇒ ConfigContext
constructor
A new instance of ConfigContext.
- #temp_configuration ⇒ Object
Constructor Details
#initialize(**options) ⇒ ConfigContext
10 11 12 13 14 |
# File 'lib/trace_viz/context/config_context.rb', line 10 def initialize(**) super @configuration = () end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
8 9 10 |
# File 'lib/trace_viz/context/config_context.rb', line 8 def configuration @configuration end |
Instance Method Details
#apply_options(options) ⇒ Object
Apply the overrides from options
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/trace_viz/context/config_context.rb', line 21 def () .each do |key, value| if temp_configuration.respond_to?("#{key}=") temp_configuration.send("#{key}=", value) else TraceViz.logger.warn("Unknown configuration option '#{key}'") end end temp_configuration end |
#temp_configuration ⇒ Object
16 17 18 |
# File 'lib/trace_viz/context/config_context.rb', line 16 def temp_configuration @temp_configuration ||= TraceViz.configuration.dup end |