lib/larva/processor.rb in larva-0.3.0 vs lib/larva/processor.rb in larva-0.4.0

- old
+ new

@@ -12,9 +12,25 @@ @id = message[:id] end def process_with_logging Propono.config.logger.info "Processing message: #{message}" + meta_process || normal_process + end + + private + + def meta_process + meta_method = "#{entity}_#{action}" + if respond_to? meta_method + self.send(meta_method) + true + else + false + end + end + + def normal_process if self.process Propono.config.logger.info "Message Processed: #{message}" else Propono.config.logger.info "Unrecognized event type, entity: #{entity} action: #{action}." end