Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module B
- def B.included(mod)
- if mod.method_defined?("john")
- mod.send :define_method, :hello_world do
- puts "greenland"
- end
- end
- end
- end
- class A
- def john
- puts "john was called"
- end
- include B
- end
- A.new.hello_world # => A does NOT have method john
Add Comment
Please, Sign In to add comment