Class: MARS::AgentStep

Inherits:
Runnable show all
Defined in:
lib/mars/agent_step.rb

Instance Attribute Summary

Attributes inherited from Runnable

#formatter, #name, #state

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Runnable

formatter, #initialize, step_name

Methods included from Hooks

included, #run_after_hooks, #run_before_hooks

Constructor Details

This class inherits a constructor from MARS::Runnable

Class Method Details

.agent(klass = nil) ⇒ Object



6
7
8
# File 'lib/mars/agent_step.rb', line 6

def agent(klass = nil)
  klass ? @agent_class = klass : @agent_class
end

Instance Method Details

#run(context) ⇒ Object



11
12
13
# File 'lib/mars/agent_step.rb', line 11

def run(context)
  self.class.agent.new.ask(context.current_input).content
end