diff --git a/lib/simplekit.rb b/lib/simplekit.rb index cfcdaef0c28575619ea6e12171d18e615bea754d..e5eb9edb20c748859b176ac35f18fc30b48a639e 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)