Matthew Kerwin wrote in post #1094954:

>
>       def lazy_init_lines
>         regEx = /^[\s]*$\n/
>         f = File.open(@file_name, 'r')
>         f.read.each_line do | line |
>           if line =~ regEx
>             @total_blank_lines += 1
>           end
>           @lines += 1
>         end
>         f.close
>       end
>
>       def lines
>         lazy_init_lines if @lines < 0
>         @lines
>       end
>
>       def total_blank_lines
>         lazy_init_lines if @total_blank_lines < 0
>         @total_blank_lines
>       end
>     end
>


`+1` nice resolution! :)

-- 
Posted via http://www.ruby-forum.com/.