Skip to content

Instantly share code, notes, and snippets.

View ihumanable's full-sized avatar

Matt Nowack ihumanable

  • San Francisco, CA
View GitHub Profile
@ihumanable
ihumanable / call_graph.ex
Created November 23, 2021 00:38
Patch Call Graph
assert {:bad, :error} == Discord.send_message(%Message{})
# We start at the Facade
Discord.send_message(%Message{}) {
# The Facade calls the Delegate
Delegate.send_message(message) {
# The Delegate checks if the Server has a patch for send_message/1
Server.delegate(Discord, :send_message, [message]) {
# The Server doesn't, so it calls the Original
Original.send_message(message) {