Permalink
Browse files

Added retrieve method to engine, and a unit-test for it

  • Loading branch information...
1 parent e551595 commit 94c1e2242b759447753f9d2accc95b67dabaa12e jkutner committed Aug 3, 2008
Showing with 5 additions and 0 deletions.
  1. +4 −0 lib/core/engine.rb
  2. +1 −0 tests/test.rb
View
@@ -207,6 +207,10 @@ def modify(object,&block)
assert(object,&block)
end
+ def retrieve(c)
+ facts.select {|f| f.kind_of?(c)}
+ end
+
# This method adds a new rule to the system.
def assert_rule(rule)
@root = RootNode.new(@working_memory) if @root == nil
View
@@ -12,4 +12,5 @@
require 'test_duck_type'
require 'test_self_reference'
require 'test_re'
+require 'gets.rb'

0 comments on commit 94c1e22

Please sign in to comment.