diff --git a/lib/simplekit.rb b/lib/simplekit.rb index 0f0ee9cdfd97d7430ecdb573cc7caad6702b0571..c6452be7b94fb9b98997e4ba6cd777b8948ef8d4 100644 --- a/lib/simplekit.rb +++ b/lib/simplekit.rb @@ -6,6 +6,7 @@ require 'pqueue' # of methods with these names in your model. All but :run are # delegated to the EventScheduler class. module SimpleKit + # This is the set of module methods to be passed to the EventScheduler DELEGATED_METHODS = [:model_time, :schedule, :halt] # Run the model by creating a new EventScheduler and invoking its run method. @@ -14,6 +15,7 @@ module SimpleKit @mySim.run end + # If a method doesn't exist in the model class, try to delegate it. def method_missing(name, *args) if DELEGATED_METHODS.include?(name) @mySim.send(name, *args)