sul-dlss/dor-services-app

View on GitHub
app/services/event_factory.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

# Creates Event records and adds the host name and invoking system identifier
class EventFactory
  def self.create(druid:, event_type:, data:)
    invoked_by = Honeybadger.get_context && Honeybadger.get_context[:invoked_by]
    event_data = data.merge(host: Socket.gethostname, invoked_by:)
    Event.create!(druid:, event_type:, data: event_data)
  end
end