Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wagenet
Created January 6, 2020 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wagenet/74c9985e69f2f265da9b89f772397183 to your computer and use it in GitHub Desktop.
Save wagenet/74c9985e69f2f265da9b89f772397183 to your computer and use it in GitHub Desktop.
class Target
def call
puts "Called"
end
end
module TargetPrepend
def call
puts "Prepend"
super
end
end
Target.prepend(TargetPrepend)
class Target
alias original_call call
def call
puts "Overwritten"
original_call
end
end
Target.new.call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment