Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module M
- end
- class A
- end
- class B < A
- end
- b = B.new
- class << b
- include M
- end
- class B < A
- include M
- end
- class << b
- p ancestors
- end
- #[#<Class:#<B:0x007fb7ea8355c8>>, M, B, M, A, Object, Kernel, BasicObject]
- #but if class B < A; include M; end before class << b; include M; end
- #[#<Class:#<B:0x007ff6e2051438>>, B, M, A, Object, Kernel, BasicObject]
Advertisement
Add Comment
Please, Sign In to add comment