Elegant dependency injection in ruby