Class: ForkBreak::BreakpointSetter
- Inherits:
-
Object
- Object
- ForkBreak::BreakpointSetter
- Defined in:
- lib/fork_break/breakpoint_setter.rb
Instance Method Summary collapse
- #<<(symbol) ⇒ Object
-
#initialize(fork, debug = false) ⇒ BreakpointSetter
constructor
A new instance of BreakpointSetter.
Constructor Details
#initialize(fork, debug = false) ⇒ BreakpointSetter
Returns a new instance of BreakpointSetter.
3 4 5 6 7 |
# File 'lib/fork_break/breakpoint_setter.rb', line 3 def initialize(fork, debug = false) @fork = fork @next_breakpoint = :forkbreak_start @debug = debug end |
Instance Method Details
#<<(symbol) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/fork_break/breakpoint_setter.rb', line 9 def <<(symbol) @fork.send_object(symbol) if symbol == @next_breakpoint @next_breakpoint = @fork.receive_object unless symbol == :forkbreak_end puts "#{@fork.pid} received #{@next_breakpoint}" if @debug end rescue EOFError => exception raise @fork.exception || exception end |