Skip to content

Instantly share code, notes, and snippets.

# TOTALLY UNTESTED. Just a sketch.
module BatchAccumulator
def batch_initialize(options={})
if ! self.class.method_defined?(:flush)
raise ArgumentError, "Any class including BatchAccumulator must define a flush() method."
end
@batch_events ||= 50