Ruby blocks, iterators and functions