Class: Puppet::Util::Profiler::Logging::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/util/profiler/logging.rb

Constant Summary collapse

INITIAL =
0
SEPARATOR =
'.'

Instance Method Summary collapse

Constructor Details

#initializeSequence

Returns a new instance of Sequence


28
29
30
# File 'lib/puppet/util/profiler/logging.rb', line 28

def initialize
  @elements = [INITIAL]
end

Instance Method Details

#downObject


36
37
38
# File 'lib/puppet/util/profiler/logging.rb', line 36

def down
  @elements << INITIAL
end

#nextObject


32
33
34
# File 'lib/puppet/util/profiler/logging.rb', line 32

def next
  @elements[-1] += 1
end

#to_sObject


44
45
46
# File 'lib/puppet/util/profiler/logging.rb', line 44

def to_s
  @elements.join(SEPARATOR)
end

#upObject


40
41
42
# File 'lib/puppet/util/profiler/logging.rb', line 40

def up
  @elements.pop
end