Some practice with metaprogramming in ruby