Class: TraceViz::Context::Registry
- Inherits:
-
Object
- Object
- TraceViz::Context::Registry
- Defined in:
- lib/trace_viz/context/registry.rb
Constant Summary collapse
- CONTEXTS =
{ config: ConfigContext, tracking: TrackingContext, }.freeze
Class Method Summary collapse
-
.build(contexts) ⇒ Hash
Builds a hash of context objects based on the provided contexts hash.
Class Method Details
.build(contexts) ⇒ Hash
Builds a hash of context objects based on the provided contexts hash.
27 28 29 30 31 32 33 |
# File 'lib/trace_viz/context/registry.rb', line 27 def build(contexts) contexts.each_with_object({}) do |(context_key, ), result| klass = CONTEXTS.fetch(context_key) result[context_key] = klass.new(**( || {})) end end |