Class: Lemans::Agent
- Inherits:
-
Object
- Object
- Lemans::Agent
- 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.
Direct Known Subclasses
Lemans::Agents::Miniswen, Lemans::Agents::Nop, Lemans::Agents::Oracle
Defined Under Namespace
Classes: Response
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
Instance Method Summary collapse
-
#initialize(profile:, model: nil) ⇒ Agent
constructor
A new instance of Agent.
-
#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.
- #name ⇒ Object
-
#run(task, environment) ⇒ Object
Run the task.
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
#model ⇒ Object (readonly)
Returns the value of attribute model.
16 17 18 |
# File 'lib/lemans/agent.rb', line 16 def model @model end |
#profile ⇒ Object (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 |
#name ⇒ Object
24 |
# File 'lib/lemans/agent.rb', line 24 def name = self.class::NAME |
#run(task, environment) ⇒ Object
Run the task.
31 32 33 |
# File 'lib/lemans/agent.rb', line 31 def run(task, environment) raise NotImplementedError end |