Created
October 5, 2011 01:16
-
-
Save ConradIrwin/1263364 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module LS | |
| class Top; def self.foo; puts "Top"; end end | |
| class Next < Top; def self.foo; puts "Next"; super; end end | |
| module M; def foo; puts "M"; super; end end | |
| module N; include M; def foo; puts "N"; super; end end | |
| module O; include M; def foo; puts "O"; super; end end | |
| module P; def foo; puts "P"; super; end end | |
| class Low < Next; include N; include P; def self.foo; puts "Low"; super; end end | |
| class Lower < Low; def self.foo; puts "Lower"; super; end end | |
| class Bottom < Lower; extend M; def self.foo; puts "Bottom"; super; end end | |
| Lower.extend N | |
| end | |
| LS::Bottom.foo | |
| puts (class << LS::Bottom; ancestors.inspect; end) | |
| puts LS::Bottom.ancestors.inspect | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment