Class: TraceViz::Formatters::BaseFormatterFactory
- Inherits:
-
Object
- Object
- TraceViz::Formatters::BaseFormatterFactory
- Defined in:
- lib/trace_viz/formatters/base_formatter_factory.rb
Direct Known Subclasses
Instance Method Summary collapse
- #fetch_formatter(key) ⇒ Object
-
#initialize(formatters) ⇒ BaseFormatterFactory
constructor
A new instance of BaseFormatterFactory.
Constructor Details
#initialize(formatters) ⇒ BaseFormatterFactory
Returns a new instance of BaseFormatterFactory.
6 7 8 |
# File 'lib/trace_viz/formatters/base_formatter_factory.rb', line 6 def initialize(formatters) @formatters = formatters.freeze end |
Instance Method Details
#fetch_formatter(key) ⇒ Object
10 11 12 13 14 |
# File 'lib/trace_viz/formatters/base_formatter_factory.rb', line 10 def fetch_formatter(key) @formatters.fetch(key) do raise ArgumentError, "Unsupported formatter key: #{key}. Available keys: #{available_keys.join(", ")}" end end |