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

Version Path
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/jls-grok-0.11.2/lib/grok/pure/match.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/jls-grok-0.11.2/lib/grok/pure/match.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/jls-grok-0.11.2/lib/grok/pure/match.rb
jls-grok-0.11.2 lib/grok/pure/match.rb
jls-grok-0.11.1 lib/grok/pure/match.rb
jls-grok-0.10.13 lib/grok/pure/match.rb
jls-grok-0.11.0 lib/grok/pure/match.rb