Sha256: 39b86c8b56247a997959df090291a122012b7f5b0e481a1ad5043d17acf1632a

Contents?: true

Size: 337 Bytes

Versions: 13

Compression:

Stored size: 337 Bytes

Contents

require 'sidekiq'
require 'active_support/inflector'

module Materialist
  class EventWorker
    include Sidekiq::Worker

    def perform(event)
      topic = event['topic']
      materializer = "#{topic.to_s.singularize.classify}Materializer".constantize
      materializer.perform(event['url'], event['type'].to_sym)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
materialist-2.3.1 lib/materialist/event_worker.rb
materialist-2.3.0 lib/materialist/event_worker.rb
materialist-2.2.0 lib/materialist/event_worker.rb
materialist-2.1.0 lib/materialist/event_worker.rb
materialist-2.0.0 lib/materialist/event_worker.rb
materialist-1.0.0 lib/materialist/event_worker.rb
materialist-0.1.0 lib/materialist/event_worker.rb
materialist-0.0.6 lib/materialist/event_worker.rb
materialist-0.0.5 lib/materialist/event_worker.rb
materialist-0.0.4 lib/materialist/event_worker.rb
materialist-0.0.3 lib/materialist/event_worker.rb
materialist-0.0.2 lib/materialist/event_worker.rb
materialist-0.0.1 lib/materialist/event_worker.rb