lib/logicle/digraph.rb in logicle-0.1.0 vs lib/logicle/digraph.rb in logicle-0.1.1
- old
+ new
@@ -4,16 +4,10 @@
def initialize
@nodes, @edges = {}, {}
end
- def evaluate
- outputs.each_value do |output|
- output.state
- end
- end
-
def inputs
@nodes.select { |id, node| node.switch? }
end
def outputs
@@ -33,9 +27,14 @@
true
else
raise_unknown_nodes(start_id => start_node, end_id => end_node)
end
end
+
+ def evaluate
+ outputs.each_value { |output| output.state }
+ end
+
private
def raise_unknown_nodes(node_map={})
bad_node_ids = node_map.select { |id, node| node.nil? }.keys