module YPetri::Simulation::Dependency

Public Class Methods

delegate_to_simulation!(*method_symbols) click to toggle source

Delegates supplied method symbols to the protected (and private) methods of the simulation.

# File lib/y_petri/simulation/dependency.rb, line 33
def self.delegate_to_simulation! *method_symbols
  method_symbols.each do |symbol|
    module_exec do
      define_method symbol do |*aa, &b| simulation.send symbol, *aa, &b end
    end
  end
end