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
10 def initialize
11   super
12   @container = {}
13   @count = Puppet::Graph::Key.new
14 end

Public Instance Methods

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