Method: Cutoff.stop
- Defined in:
- lib/cutoff.rb
.stop(cutoff = nil) ⇒ Cutoff?
Remove the top Cutoff from the stack
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/cutoff.rb', line 51 def stop(cutoff = nil) stack = Thread.current[CURRENT_STACK_KEY] return unless stack top = stack.last stack.pop if cutoff.nil? || top == cutoff clear_all if stack.empty? cutoff end |