published on 22.09.2006 22:32.

smoke this.

the following code execudes just fine (the puts are executed in order 1-7, no parse errors). earns an anything-special-about-that? shrug from the ruby crowd, a highly disturbed look from everyone else (including me).

module Acid
    puts "1) My first Acid."    
    def self.append_features(mod)
        puts "4) Now #{mod.class}'s taken Acid."
        mod.extend(self)
    end
  end

class Bus
    puts "2) Now that's a boring bus."
end

class Furthur < Bus
    puts "3) First, setup the fuel."
    include Acid
    puts "5) Lets get on the magic bus."
    def initialize
        puts "6) A magic bus has been set up."
    end
    def play_hippie_music
        puts "7) Driving Home. That's it, folks!"
    end
end

magic_bus = Furthur.new
magic_bus.play_hippie_music

Posted in ,