Skip to content

Instantly share code, notes, and snippets.

@erkattak
Last active December 21, 2015 04:49
Show Gist options
  • Save erkattak/6252073 to your computer and use it in GitHub Desktop.
Save erkattak/6252073 to your computer and use it in GitHub Desktop.
how would one refactor this?
DeviceCloud.event_notification_processors = [ ParkingSessionEventHandler, ParkingLotEventHandler, PermitPurchaseEventHandler ]
DeviceCloud.event_notification_handler = Proc.new do |event_notification|
DeviceCloud.event_notification_processors.each { |processor| processor.perform_async(event_notification.raw_data) if processor.processable?(event_notification.type) }
end
@erkattak
Copy link
Author

Not sure if adding a processors config to the device_cloud gem makes sense. In this case the only real reason I need it is because one event type needs the meter..

Need to refactor the gem to take out any assumptions about what kind of data is in the device cloud FileData

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment