Ruby: Exit Hook