Class: Stackdo::CallStack
- Inherits:
-
Object
- Object
- Stackdo::CallStack
- Defined in:
- lib/stackdo.rb
Instance Attribute Summary collapse
-
#frames ⇒ Object
readonly
Returns the value of attribute frames.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(frames:) ⇒ CallStack
constructor
A new instance of CallStack.
- #walk(&block) ⇒ Object
Constructor Details
#initialize(frames:) ⇒ CallStack
Returns a new instance of CallStack.
83 84 85 |
# File 'lib/stackdo.rb', line 83 def initialize(frames:) @frames = frames end |
Instance Attribute Details
#frames ⇒ Object (readonly)
Returns the value of attribute frames.
73 74 75 |
# File 'lib/stackdo.rb', line 73 def frames @frames end |
Class Method Details
.from_here ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/stackdo.rb', line 75 def self.from_here frames = Stackdo::call_stack_bindings(binding).map do |binding| Stackdo::Frame.from_binding(binding) end CallStack.new(frames: frames) end |
Instance Method Details
#walk(&block) ⇒ Object
87 88 89 |
# File 'lib/stackdo.rb', line 87 def walk(&block) frames.each(&block) end |