Skip to content

Instantly share code, notes, and snippets.

@banister
Forked from anonymous/gist:4683679
Created January 31, 2013 15:29
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 banister/4683697 to your computer and use it in GitHub Desktop.
Save banister/4683697 to your computer and use it in GitHub Desktop.
class Child
end
age = 12
test_module = Module.new do
define_method(:say_hello) do
puts "Hello from module, I am #{age} years old"
end
end
Child.send :include, test_module
Child.new.say_hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment