Skip to content

Instantly share code, notes, and snippets.

@joecannatti
Last active August 29, 2015 14:07
Show Gist options
  • Save joecannatti/f7e0a2f1480e79cde5db to your computer and use it in GitHub Desktop.
Save joecannatti/f7e0a2f1480e79cde5db to your computer and use it in GitHub Desktop.
Panda
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