Last active
August 29, 2015 14:07
-
-
Save joecannatti/f7e0a2f1480e79cde5db to your computer and use it in GitHub Desktop.
Panda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Rule | |
def self.add_reaction(reaction) | |
@reactions << reaction | |
end | |
end | |
class DuplicateFound < Rule | |
def match(records) | |
#dup logic | |
end | |
end | |
class DeleteRecord | |
def perform(record) | |
#del | |
end | |
end | |
class NotifyEng | |
def perform(record) | |
#send email | |
end | |
end | |
# in initializer | |
DuplicateFound.add_reaction(DeleteRecord) | |
DuplicateFound.add_reaction(NotifyEng) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment