Class: Trailblazer::Developer::Trace::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/trailblazer/developer/trace/stack.rb

Overview

The stack is a linear one-dimensional array. Per traced task two Captured elements get pushed onto it (unless there’s an Exception).

Instance Method Summary collapse

Constructor Details

#initialize(captureds = []) ⇒ Stack

Returns a new instance of Stack.



7
8
9
# File 'lib/trailblazer/developer/trace/stack.rb', line 7

def initialize(captureds=[])
  @stack = captureds
end

Instance Method Details

#<<(captured) ⇒ Object



11
12
13
# File 'lib/trailblazer/developer/trace/stack.rb', line 11

def <<(captured)
  @stack << captured
end

#to_aObject



15
16
17
# File 'lib/trailblazer/developer/trace/stack.rb', line 15

def to_a
  @stack
end