Class: Puppet::Graph::RandomPrioritizer Private

Inherits:
Prioritizer show all
Defined in:
lib/puppet/graph/random_prioritizer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Assign a random priority to items.

Instance Method Summary collapse

Methods inherited from Prioritizer

#forget, #initialize, #priority_of, #record_priority_for

Constructor Details

This class inherits a constructor from Puppet::Graph::Prioritizer

Instance Method Details

#generate_priority_contained_in(container, key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
# File 'lib/puppet/graph/random_prioritizer.rb', line 13

def generate_priority_contained_in(container, key)
  generate_priority_for(key)
end

#generate_priority_for(key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
8
9
10
11
# File 'lib/puppet/graph/random_prioritizer.rb', line 5

def generate_priority_for(key)
  if priority_of(key).nil?
    record_priority_for(key, SecureRandom.uuid)
  else
    priority_of(key)
  end
end