Class: Mihari::Emitters::Base

Inherits:
Object
  • Object
show all
Includes:
Configurable, Retriable
Defined in:
lib/mihari/emitters/base.rb

Direct Known Subclasses

Database, MISP, Slack, StandardOutput, TheHive

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Retriable

#retry_on_error

Methods included from Configurable

#config_keys, #configuration_status, #configured?

Class Method Details

.inherited(child) ⇒ Object



9
10
11
# File 'lib/mihari/emitters/base.rb', line 9

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

Instance Method Details

#emitObject

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/mihari/emitters/base.rb', line 22

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

#run(**params) ⇒ Object



18
19
20
# File 'lib/mihari/emitters/base.rb', line 18

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

#valid?true, false

Returns:

  • (true, false)

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/mihari/emitters/base.rb', line 14

def valid?
  raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end