Class: Vissen::Parameterized::Graph
- Inherits:
-
Object
- Object
- Vissen::Parameterized::Graph
- Defined in:
- lib/vissen/parameterized/graph.rb
Overview
The graph implements a mechanism for updating and untainting a set of interconnected paramaeterized objects.
Instance Method Summary collapse
-
#initialize(end_nodes, scope: GlobalScope.instance) ⇒ Graph
constructor
A new instance of Graph.
-
#update! ⇒ Object
Updates the entire graph.
Constructor Details
#initialize(end_nodes, scope: GlobalScope.instance) ⇒ Graph
Returns a new instance of Graph.
15 16 17 18 19 20 21 22 23 |
# File 'lib/vissen/parameterized/graph.rb', line 15 def initialize(end_nodes, scope: GlobalScope.instance) end_nodes.each do |node| raise ScopeError unless scope.include? node end @end_nodes = end_nodes freeze end |
Instance Method Details
#update! ⇒ Object
Updates the entire graph.
26 27 28 29 30 31 |
# File 'lib/vissen/parameterized/graph.rb', line 26 def update! @end_nodes.each(&:tainted?) @end_nodes.each(&:untaint!) @end_nodes.each { |node| yield node.value } if block_given? end |