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.



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

def initialize
  @elements = [INITIAL]
end

Instance Method Details

#downObject



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

def down
  @elements << INITIAL
end

#nextObject



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

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

#to_sObject



46
47
48
# File 'lib/puppet/util/profiler/logging.rb', line 46

def to_s
  @elements.join(SEPARATOR)
end

#upObject



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

def up
  @elements.pop
end