Module: Krikri::SoftwareAgent

Extended by:
ActiveSupport::Concern
Included in:
Enrichment, Harvester, Mapper::Agent
Defined in:
lib/krikri/software_agent.rb

Overview

SoftwareAgent is a mixin for logic common to code that generates a Krikri::Activity.

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

Logger =
ActiveSupport::TaggedLogging.new(Rails.logger)

Instance Method Summary collapse

Instance Method Details

#agent_nameObject

Return an agent name suitable for saving in an Activity. This is the name of the most-derived class upon which this is invoked.

See Also:


15
16
17
# File 'lib/krikri/software_agent.rb', line 15

def agent_name
  self.class.agent_name
end

#log(priority, msg) ⇒ Object

See Also:


28
29
30
# File 'lib/krikri/software_agent.rb', line 28

def log(priority, msg)
  self.class.log(priority, msg)
end

#runBoolean

This method is abstract.

Perform this agent's work

Returns:

  • (Boolean)

22
23
24
# File 'lib/krikri/software_agent.rb', line 22

def run
  fail NotImplementedError
end