Sha256: 82843e4f43b14bf7ccc87c4b075f2785abeebd7b0bf5aa41bc34a3283c60723c

Contents?: true

Size: 541 Bytes

Versions: 6

Compression:

Stored size: 541 Bytes

Contents

module GeoWorks
  class GeoblacklightEventProcessor
    attr_reader :event
    def initialize(event)
      @event = event
    end

    delegate :process, to: :processor

    private

      def event_type
        event['event']
      end

      def processor
        case event_type
        when 'CREATED'
          UpdateProcessor.new(event)
        when 'UPDATED'
          UpdateProcessor.new(event)
        when 'DELETED'
          DeleteProcessor.new(event)
        else
          UnknownEvent.new(event)
        end
      end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
geo_works-0.2.0 app/processors/geo_works/geoblacklight_event_processor.rb
geo_works-0.1.4 app/processors/geo_works/geoblacklight_event_processor.rb
geo_works-0.1.3 app/processors/geo_works/geoblacklight_event_processor.rb
geo_works-0.1.2 app/processors/geo_works/geoblacklight_event_processor.rb
geo_works-0.1.1 app/processors/geo_works/geoblacklight_event_processor.rb
geo_works-0.1.0 app/processors/geo_works/geoblacklight_event_processor.rb