Method: Fluent::Plugin::Output#implement?

Defined in:
lib/fluent/plugin/output.rb

#implement?(feature) ⇒ Boolean

Returns:

  • (Boolean)


651
652
653
654
655
656
657
658
659
660
661
# File 'lib/fluent/plugin/output.rb', line 651

def implement?(feature)
  methods_of_plugin = self.class.instance_methods(false)
  case feature
  when :synchronous    then methods_of_plugin.include?(:process) || support_in_v12_style?(:synchronous)
  when :buffered       then methods_of_plugin.include?(:write) || support_in_v12_style?(:buffered)
  when :delayed_commit then methods_of_plugin.include?(:try_write)
  when :custom_format  then methods_of_plugin.include?(:format) || support_in_v12_style?(:custom_format)
  else
    raise ArgumentError, "Unknown feature for output plugin: #{feature}"
  end
end