4 class Tries < PollCondition
5 attr_accessor :times, :within
8 @timeline = Timeline.new(self.times)
13 valid &= complain("You must specify the 'times' attribute for :tries") if self.times.nil?
20 concensus = (@timeline.size == self.times)
21 duration = within.nil? || (@timeline.last - @timeline.first) < self.within
23 if concensus && duration
24 @timeline.clear if within.nil?