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