Skip to content
Snippets Groups Projects
Commit 9abd2f30 authored by pjs's avatar pjs
Browse files

Merge branch 'master' of or.nps.edu:simplekit-ruby

parents e4329e35 c300f3bf
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ require 'pqueue' ...@@ -6,6 +6,7 @@ require 'pqueue'
# of methods with these names in your model. All but :run are # of methods with these names in your model. All but :run are
# delegated to the EventScheduler class. # delegated to the EventScheduler class.
module SimpleKit module SimpleKit
# This is the set of module methods to be passed to the EventScheduler
DELEGATED_METHODS = [:model_time, :schedule, :halt] DELEGATED_METHODS = [:model_time, :schedule, :halt]
# Run the model by creating a new EventScheduler and invoking its run method. # Run the model by creating a new EventScheduler and invoking its run method.
...@@ -14,6 +15,7 @@ module SimpleKit ...@@ -14,6 +15,7 @@ module SimpleKit
@mySim.run @mySim.run
end end
# If a method doesn't exist in the model class, try to delegate it.
def method_missing(name, *args) def method_missing(name, *args)
if DELEGATED_METHODS.include?(name) if DELEGATED_METHODS.include?(name)
@mySim.send(name, *args) @mySim.send(name, *args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment