module Riffer::Rig::Commands::Trace
Constants
- NO_TURN
Public Instance Methods
(Riffer::Rig::Stores::_Reader store) → Riffer::Rig::Command
Source
# File lib/riffer/rig/commands/trace.rb, line 10 def command(store) Riffer::Rig::Command.new( 'trace', description: "Replay the last turn's activity from the session store", extension: :core ) { |ctx| run(store, ctx) } end
@rbs store: Riffer::Rig::Stores::_Reader @rbs return: Riffer::Rig::Command
(Riffer::Rig::Stores::_Reader store, Riffer::Rig::Command::Context ctx) → void
Source
# File lib/riffer/rig/commands/trace.rb, line 21 def run(store, ctx) lines = Riffer::Rig::Commands::Trace::Replay.lines(store.read(ctx.runtime.id)) ctx.say(lines.empty? ? NO_TURN : lines.join("\n")) end
@rbs store: Riffer::Rig::Stores::_Reader @rbs ctx: Riffer::Rig::Command::Context @rbs return: void