class Conrad::Processors::AddUUID

Generalized processor for inserting a UUID into the event. Allows configuring the key used for insertion.

@!attribute [r] uuid_key

The key inserted into the event hash for the generated UUID.

Attributes

uuid_key[R]

Public Class Methods

new(uuid_key = :event_uuid) click to toggle source

@param uuid_key [Symbol] key to use for the generated UUID

# File lib/conrad/processors/add_uuid.rb, line 15
def initialize(uuid_key = :event_uuid)
  @uuid_key = uuid_key
end

Public Instance Methods

call(event) click to toggle source

@param event [Hash] the current event

@return [Hash] the hash with the UUID inserted

# File lib/conrad/processors/add_uuid.rb, line 22
def call(event)
  event.merge(uuid_key => SecureRandom.uuid)
end