Class: Lemans::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/lemans/agent.rb

Overview

What the harness asks of an agent: install yourself, then work on the task. The name-to-class registry lives on the Agents module.

Defined Under Namespace

Classes: Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(profile:, model: nil) ⇒ Agent

Returns a new instance of Agent.



18
19
20
21
22
# File 'lib/lemans/agent.rb', line 18

def initialize(profile:, model: nil)
  @profile = profile

  @model = model || profile.model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



16
17
18
# File 'lib/lemans/agent.rb', line 16

def model
  @model
end

#profileObject (readonly)

Returns the value of attribute profile.



16
17
18
# File 'lib/lemans/agent.rb', line 16

def profile
  @profile
end

Instance Method Details

#install(_task, _environment) ⇒ Object

Run before the agent phase's network policy narrows, so an agent that pulls its own runtime can still reach a package index.



28
# File 'lib/lemans/agent.rb', line 28

def install(_task, _environment) = nil

#nameObject



24
# File 'lib/lemans/agent.rb', line 24

def name = self.class::NAME

#run(task, environment) ⇒ Object

Run the task.

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/lemans/agent.rb', line 31

def run(task, environment)
  raise NotImplementedError
end