Class: Madeleine::Automatic::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/madeleine/automatic.rb

Overview

A Command object is automatically created for each method call to an object within the system that comes from without. These objects are recorded in the log by Madeleine.

Instance Method Summary collapse

Constructor Details

#initialize(symbol, myid, *args) ⇒ Command

Returns a new instance of Command.



135
136
137
138
139
# File 'lib/madeleine/automatic.rb', line 135

def initialize(symbol, myid, *args)
  @symbol = symbol
  @myid = myid
  @args = args
end

Instance Method Details

#execute(system) ⇒ Object

Called by madeleine when the command is done either first time, or when restoring the log



143
144
145
# File 'lib/madeleine/automatic.rb', line 143

def execute(system)
  Thread.current[:system].myid2ref(@myid).thing.send(@symbol, *@args)
end