Benutzer:Oneup/Hence Ruby Owns Your Ass

aus Metalab Wiki, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Zur Navigation springenZur Suche springen

here we sort & order various smart tidbits we stumble upon while ordering ruby's word dictionary.

module Janitor
    def initialize
        super
        puts "janitor"
    end
end

module Xanitor
    def initialize
       super
       puts "xanitor"
    end
end

class C
 include Janitor
 include Xanitor
end

C.new



# OUTPUT:
# janitor
# xanitor

# hence we have the capability to horizontally apprehend features in ruby
# (class super only works vertically)