Thanks to all who replied, like all ruby it was alot simpler than I
thought.

class Fred
        include Enumerable

        def initialize
                @end = 10
                @pointer = 0
        end

        def each
                while @pointer != @end do
                        @pointer += 1
                        yield @pointer
                end
                @pointer = 0
        end
end