Class: Puppet::Graph::Key Private

Inherits:
Object show all
Includes:
Comparable
Defined in:
lib/puppet/graph/key.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.

Sequential, nestable keys for tracking order of insertion in “the graph”

API:

  • private

Instance Method Summary collapse

Constructor Details

#initialize(value = [0]) ⇒ Key

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.

Returns a new instance of Key.

API:

  • private



10
11
12
# File 'lib/puppet/graph/key.rb', line 10

def initialize(value = [0])
  @value = value
end

Instance Method Details

#<=>(other) ⇒ 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.

API:

  • private



24
25
26
# File 'lib/puppet/graph/key.rb', line 24

def <=>(other)
  @value <=> other.value
end

#downObject

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.

API:

  • private



20
21
22
# File 'lib/puppet/graph/key.rb', line 20

def down
  Puppet::Graph::Key.new(@value + [0])
end

#nextObject

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.

API:

  • private



14
15
16
17
18
# File 'lib/puppet/graph/key.rb', line 14

def next
  next_values = @value.clone
  next_values[-1] += 1
  Puppet::Graph::Key.new(next_values)
end