class Sherlog::OccurrenceListener
Public Class Methods
new(max_occurrences)
click to toggle source
# File lib/sherlog_holmes/listeners/occurrence_listener.rb, line 27 def initialize(max_occurrences) @max = max_occurrences.to_i @count = 0 end
Public Instance Methods
call(entry)
click to toggle source
# File lib/sherlog_holmes/listeners/occurrence_listener.rb, line 32 def call(entry) @count += 1 entry.process.stop if @count >= @max end