Different implementations of handling events in Ruby