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.



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

def initialize
  @elements = [INITIAL]
end

Instance Method Details

#downObject



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

def down
  @elements << INITIAL
end

#nextObject



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

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

#to_sObject



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

def to_s
  @elements.join(SEPARATOR)
end

#upObject



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

def up
  @elements.pop
end