Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplekit-ruby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sanchez, Paul
simplekit-ruby
Commits
9abd2f30
Commit
9abd2f30
authored
13 years ago
by
pjs
Browse files
Options
Downloads
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/simplekit.rb
+2
-0
2 additions, 0 deletions
lib/simplekit.rb
with
2 additions
and
0 deletions
lib/simplekit.rb
+
2
−
0
View file @
9abd2f30
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment