Module: LogStash::Inputs::AkamaiSiem::MiddlewareRegistry
Instance Method Summary collapse
-
#lookup_middleware(key) ⇒ Class
Lookup middleware class with a registered Symbol shortcut.
-
#register_middleware(**mappings) ⇒ void
Register middleware class(es) on the current module.
-
#registered_middleware ⇒ Object
Adds the ability for other modules to register and lookup middleware classes.
-
#unregister_middleware(key) ⇒ Object
Unregister a previously registered middleware class.
Instance Method Details
#lookup_middleware(key) ⇒ Class
Lookup middleware class with a registered Symbol shortcut.
54 55 56 57 |
# File 'lib/logstash/inputs/akamai_siem/middleware_registry.rb', line 54 def lookup_middleware(key) load_middleware(key) || raise(Faraday::Error, "#{key.inspect} is not registered on #{self}") end |
#register_middleware(**mappings) ⇒ void
This method returns an undefined value.
Register middleware class(es) on the current module.
25 26 27 28 29 |
# File 'lib/logstash/inputs/akamai_siem/middleware_registry.rb', line 25 def register_middleware(**mappings) middleware_mutex do registered_middleware.update(mappings) end end |
#registered_middleware ⇒ Object
Adds the ability for other modules to register and lookup middleware classes.
8 9 10 |
# File 'lib/logstash/inputs/akamai_siem/middleware_registry.rb', line 8 def registered_middleware @registered_middleware ||= {} end |
#unregister_middleware(key) ⇒ Object
Unregister a previously registered middleware class.
34 35 36 |
# File 'lib/logstash/inputs/akamai_siem/middleware_registry.rb', line 34 def unregister_middleware(key) registered_middleware.delete(key) end |