Created
February 18, 2014 16:31
-
-
Save tagomoris/9074355 to your computer and use it in GitHub Desktop.
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
module HookPoints; end | |
using HookPoints | |
require 'super_storage_x' | |
class Target | |
def testing_method | |
SuperStorageX.store("x") | |
end | |
end | |
Target.new.testing_method() |
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
require 'code_now_testing' | |
# output "stored anywhare" |
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 SuperStorage | |
def store(data) | |
p "stored anywhere!" | |
end | |
end | |
SuperStorageX = SuperStorage.new |
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
module HookPoints | |
refine SuperStorage do | |
def store(data) | |
p "store hooked!" | |
end | |
end | |
end | |
require 'code_now_testing' | |
# output "store hooked!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment