Module: LogStash::PluginMixins::EventSupport::EventFactoryAdapter::FallbackImpl
- Defined in:
- lib/logstash/plugin_mixins/event_support/event_factory_adapter/fallback_impl.rb
Instance Method Summary collapse
-
#event_factory ⇒ Object
The event_factory method is effectively final and should not be re-defined by plugins.
-
#targeted_event_factory ⇒ Object
The
targeted_event_factorymethod is effectively final and should not be re-defined.
Instance Method Details
#event_factory ⇒ Object
The event_factory method is effectively final and should not be re-defined by plugins.
8 9 10 |
# File 'lib/logstash/plugin_mixins/event_support/event_factory_adapter/fallback_impl.rb', line 8 def event_factory @_event_factory ||= BasicEventFactory::INSTANCE end |
#targeted_event_factory ⇒ Object
The targeted_event_factory method is effectively final and should not be re-defined.
If the plugin defines a target => ... option than this method will return a factory
that respects the set target, otherwise (no target) returns #event_factory.
17 18 19 20 21 22 |
# File 'lib/logstash/plugin_mixins/event_support/event_factory_adapter/fallback_impl.rb', line 17 def targeted_event_factory @_targeted_event_factory ||= begin # not synchronized - fine to initialize twice raise ArgumentError.new('config(:target) not present') unless respond_to?(:target) target.nil? ? event_factory : TargetedEventFactory.new(event_factory, target) end end |