Skip to content

Instantly share code, notes, and snippets.

@tagomoris
Created February 18, 2014 16:31
Show Gist options
  • Save tagomoris/9074355 to your computer and use it in GitHub Desktop.
Save tagomoris/9074355 to your computer and use it in GitHub Desktop.
module HookPoints; end
using HookPoints
require 'super_storage_x'
class Target
def testing_method
SuperStorageX.store("x")
end
end
Target.new.testing_method()
require 'code_now_testing'
# output "stored anywhare"
class SuperStorage
def store(data)
p "stored anywhere!"
end
end
SuperStorageX = SuperStorage.new
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