Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filters/varnishlog.rb

Overview

Extenting array class to to an something like grep -v

Instance Method Summary collapse

Instance Method Details

#grepv(regex, &block) ⇒ Object



12
13
14
# File 'lib/logstash/filters/varnishlog.rb', line 12

def grepv(regex, &block)
  self.reject { |elem| elem.match(/#{regex}/i) }.each(&block)
end