Ruby: reducing context