Sha256: 50011e234152dc5fd95bcb7f47ce15586f676f05c2ee7ce78315ef812109b901

Contents?: true

Size: 649 Bytes

Versions: 29

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true

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

      def initialize(*)
      end

      class << self
        def inherited(child)
          super
          Mihari.emitters << child
        end
      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

29 entries across 29 versions & 1 rubygems

Version Path
mihari-5.2.2 lib/mihari/emitters/base.rb
mihari-5.2.1 lib/mihari/emitters/base.rb
mihari-5.2.0 lib/mihari/emitters/base.rb
mihari-5.1.4 lib/mihari/emitters/base.rb
mihari-5.1.3 lib/mihari/emitters/base.rb
mihari-5.1.2 lib/mihari/emitters/base.rb
mihari-5.1.1 lib/mihari/emitters/base.rb
mihari-5.1.0 lib/mihari/emitters/base.rb
mihari-5.0.1 lib/mihari/emitters/base.rb
mihari-5.0.0 lib/mihari/emitters/base.rb
mihari-4.12.0 lib/mihari/emitters/base.rb
mihari-4.11.0 lib/mihari/emitters/base.rb
mihari-4.10.0 lib/mihari/emitters/base.rb
mihari-4.9.0 lib/mihari/emitters/base.rb
mihari-4.8.0 lib/mihari/emitters/base.rb
mihari-4.7.4 lib/mihari/emitters/base.rb
mihari-4.7.3 lib/mihari/emitters/base.rb
mihari-4.7.2 lib/mihari/emitters/base.rb
mihari-4.7.1 lib/mihari/emitters/base.rb
mihari-4.7.0 lib/mihari/emitters/base.rb