example code didn't look quite right

You're calling the method as `foo` not as `$`  :)

(love the idea btw)