Class: RubyLLM::Monitoring::ChannelRegistry
- Inherits:
-
Object
- Object
- RubyLLM::Monitoring::ChannelRegistry
- Defined in:
- lib/ruby_llm/monitoring/channel_registry.rb
Instance Method Summary collapse
- #fetch(name) ⇒ Object
-
#initialize ⇒ ChannelRegistry
constructor
A new instance of ChannelRegistry.
- #register(name, klass) ⇒ Object
Constructor Details
#initialize ⇒ ChannelRegistry
Returns a new instance of ChannelRegistry.
4 5 6 |
# File 'lib/ruby_llm/monitoring/channel_registry.rb', line 4 def initialize @registry = {} end |
Instance Method Details
#fetch(name) ⇒ Object
12 13 14 15 16 |
# File 'lib/ruby_llm/monitoring/channel_registry.rb', line 12 def fetch(name) @registry.fetch(name.to_sym) do raise ArgumentError, "Unknown channel: #{name}. Registered: #{@registry.keys.join(', ')}" end end |
#register(name, klass) ⇒ Object
8 9 10 |
# File 'lib/ruby_llm/monitoring/channel_registry.rb', line 8 def register(name, klass) @registry[name.to_sym] = klass end |