Sha256: 64dfc8880f367772fec993754b72cf6e7fcc82acfecc8da5d9da6ae10e05d052

Contents?: true

Size: 491 Bytes

Versions: 20

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true
# Sequential, nestable keys for tracking order of insertion in "the graph"
# @api private
class Puppet::Graph::Key
  include Comparable

  attr_reader :value
  protected :value

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

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

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

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/graph/key.rb
puppet-8.3.0-x86-mingw32 lib/puppet/graph/key.rb
puppet-8.3.0-x64-mingw32 lib/puppet/graph/key.rb
puppet-8.3.0-universal-darwin lib/puppet/graph/key.rb
puppet-8.3.1 lib/puppet/graph/key.rb
puppet-8.3.1-x86-mingw32 lib/puppet/graph/key.rb
puppet-8.3.1-x64-mingw32 lib/puppet/graph/key.rb
puppet-8.3.1-universal-darwin lib/puppet/graph/key.rb
puppet-8.2.0 lib/puppet/graph/key.rb
puppet-8.2.0-x86-mingw32 lib/puppet/graph/key.rb
puppet-8.2.0-x64-mingw32 lib/puppet/graph/key.rb
puppet-8.2.0-universal-darwin lib/puppet/graph/key.rb
puppet-8.1.0 lib/puppet/graph/key.rb
puppet-8.1.0-x86-mingw32 lib/puppet/graph/key.rb
puppet-8.1.0-x64-mingw32 lib/puppet/graph/key.rb
puppet-8.1.0-universal-darwin lib/puppet/graph/key.rb
puppet-8.0.1 lib/puppet/graph/key.rb
puppet-8.0.1-x86-mingw32 lib/puppet/graph/key.rb
puppet-8.0.1-x64-mingw32 lib/puppet/graph/key.rb
puppet-8.0.1-universal-darwin lib/puppet/graph/key.rb