Sha256: cf0364ddd1db67d102e17d9c7d14a76cb95fdb1d695fc3cb8bf33feeb7582f8a

Contents?: true

Size: 248 Bytes

Versions: 2

Compression:

Stored size: 248 Bytes

Contents

require 'json'

class Woodchuck::Input::JsonEvent < Woodchuck::Input
	protected

	def prepare_hash(path, line)
		super(path, line).merge(
			parse_json(line)
		)
	end

	def parse_json(line)
		begin
			JSON.parse(line)
		rescue
			{}
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
woodchuck-json-event-0.0.2 lib/woodchuck/input/json_event.rb
woodchuck-json-event-0.0.1 lib/woodchuck/input/json_event.rb