Sha256: 2eab54effd9fad815fea059c5a2826ba5e0861f58a3eb56626c45b2525317c3a

Contents?: true

Size: 567 Bytes

Versions: 17

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Emitters
    class Base
      include Mixins::Configurable
      include Mixins::Retriable

      def self.inherited(child)
        Mihari.emitters << child
      end

      # @return [Boolean]
      def valid?
        raise NotImplementedError, "You must implement #{self.class}##{__method__}"
      end

      def run(**params)
        retry_on_error { emit(**params) }
      end

      def emit(*)
        raise NotImplementedError, "You must implement #{self.class}##{__method__}"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mihari-4.1.2 lib/mihari/emitters/base.rb
mihari-4.1.1 lib/mihari/emitters/base.rb
mihari-4.1.0 lib/mihari/emitters/base.rb
mihari-4.0.0 lib/mihari/emitters/base.rb
mihari-3.12.0 lib/mihari/emitters/base.rb
mihari-3.11.0 lib/mihari/emitters/base.rb
mihari-3.10.1 lib/mihari/emitters/base.rb
mihari-3.10.0 lib/mihari/emitters/base.rb
mihari-3.9.2 lib/mihari/emitters/base.rb
mihari-3.9.1 lib/mihari/emitters/base.rb
mihari-3.9.0 lib/mihari/emitters/base.rb
mihari-3.8.1 lib/mihari/emitters/base.rb
mihari-3.8.0 lib/mihari/emitters/base.rb
mihari-3.7.2 lib/mihari/emitters/base.rb
mihari-3.7.1 lib/mihari/emitters/base.rb
mihari-3.7.0 lib/mihari/emitters/base.rb
mihari-3.6.1 lib/mihari/emitters/base.rb