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

#initialize ⇒ Sequence

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

#down ⇒ Object



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

def down
  @elements << INITIAL
end

#next ⇒ Object



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

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

#to_s ⇒ Object



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

def to_s
  @elements.join(SEPARATOR)
end

#up ⇒ Object



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

def up
  @elements.pop
end