search for: has_iterated

Displaying 1 result from an estimated 1 matches for "has_iterated".

2008 Jun 05
1
Using and_yield to pass multiple or no iterations
Hi, imagine there''s a class called Egg which has the following method (which calls another method): <CODE> def do_thing has_iterated = false self.each_row do |row| has_iterated = true unless has_iterated end has_iterated end </CODE> Stupid code, I know. I have two questions with it. The first is, would it be possible to set it up to test the case when each_row operates on an empty Array? Sort of like this: &l...