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.



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

def initialize
  @elements = [INITIAL]
end

Instance Method Details

#down ⇒ Object



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

def down
  @elements << INITIAL
end

#next ⇒ Object



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

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

#to_s ⇒ Object



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

def to_s
  @elements.join(SEPARATOR)
end

#up ⇒ Object



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

def up
  @elements.pop
end