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.



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

def initialize
  @elements = [INITIAL]
end

Instance Method Details

#downObject



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

def down
  @elements << INITIAL
end

#nextObject



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

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

#to_sObject



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

def to_s
  @elements.join(SEPARATOR)
end

#upObject



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

def up
  @elements.pop
end