Sha256: 7612139e1f970d1c48339a70aff05f7780a299154579d28e1efb067409598e75

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

module Larva
  class Processor
    def self.process(message)
      new(message).process_with_logging
    end

    attr_accessor :message, :action, :entity, :id
    def initialize(message)
      @message = message
      @action = message[:action]
      @entity = message[:entity]
      @id = message[:id]
    end

    def process_with_logging
      Propono.config.logger.info "Processing message: #{message}"
      if self.process
        Propono.config.logger.info "Message Processed: #{message}"
      else
        Propono.config.logger.info "Unrecognized event type, entity: #{entity} action: #{action}."
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
larva-0.3.0 lib/larva/processor.rb