Skip to content

Instantly share code, notes, and snippets.

@ranjib
Created March 13, 2014 17:31
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 ranjib/9533011 to your computer and use it in GitHub Desktop.
Save ranjib/9533011 to your computer and use it in GitHub Desktop.
class MyRecipe
end
module Extension
def foo
end
end
r1 = MyRecipe.new
r2 = MyRecipe.new
r1.instance_eval do
extend Extension
end
r1.respond_to?(:foo) # true
r2.respond_to?(:foo) # false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment