Sha256: 9333c17e2b973c94bddd3226f6adda9aaa7623d35d6ddaf6f496fbd2dac5810c
Contents?: true
Size: 558 Bytes
Versions: 7
Compression:
Stored size: 558 Bytes
Contents
require "grok-pure" class Grok::Match attr_accessor :subject attr_accessor :grok attr_accessor :match public def initialize @captures = nil end public def each_capture(&block) @grok.capture(@match, block) end # def each_capture public def captures if @captures.nil? @captures = Hash.new { |h,k| h[k] = [] } each_capture do |key, val| @captures[key] << val end end return @captures end # def captures public def [](name) return captures[name] end # def [] end # Grok::Match
Version data entries
7 entries across 7 versions & 2 rubygems