From: Douglas Livingstone Date: 2005-04-09T18:13:41+09:00 Subject: Re: [EVALUATION] - E04 - jamPersist Evaluation Case Applied to Ruby I love it :) On Apr 8, 2005 11:11 PM, Ben Giddings wrote: > On Friday 08 April 2005 17:14, Ilias Lazaridis wrote: > > please avoid further off-topic comments. > > class FightClubRules > # 1 > def to_s > "" > end > > # 2 > def inspect > "" > end > > # 3 > def over? > @fighters.each do |f| > return true if f.limp? or f.gets =~ /stop!/ > end > false > end > > # 4 > def add_fighter(fighter) > @fighters ||= [] > @fighters.size <= 2 or raise "Too many fighters!" > @fighters << fighter > end > > # 5 > include Singleton > > # 6 > def clothing_valid? > @fighters.each do |f| > return false if f.clothing.include?(:shirt) or > f.clothing.include?(:shoes) > end > true > end > > # 7 > def timer_expired?; false; end > > # 8 > def initialize(crowd) > crowd.each do |visitor| > if visitor.first_visit? > add_fighter(visitor) > end > end > end > end > >