class Puppet::Graph::SequentialPrioritizer

This implements a priority in which keys are given values that will keep them in the same priority in which they priorities are requested. Nested structures (those in which a key is contained within another key) are preserved in such a way that child keys are after the parent and before the key after the parent.

@api private

Public Class Methods

new() click to toggle source
Calls superclass method Puppet::Graph::Prioritizer::new
   # File lib/puppet/graph/sequential_prioritizer.rb
 9 def initialize
10   super
11   @container = {}
12   @count = Puppet::Graph::Key.new
13 end

Public Instance Methods

generate_priority_contained_in(container, key) click to toggle source
   # File lib/puppet/graph/sequential_prioritizer.rb
24 def generate_priority_contained_in(container, key)
25   @container[container] ||= priority_of(container).down
26   priority = @container[container].next
27   record_priority_for(key, priority)
28   @container[container] = priority
29   priority
30 end
generate_priority_for(key) click to toggle source
   # File lib/puppet/graph/sequential_prioritizer.rb
15 def generate_priority_for(key)
16   if priority_of(key).nil?
17     @count = @count.next
18     record_priority_for(key, @count)
19   else
20     priority_of(key)
21   end
22 end