Created
June 8, 2015 22:24
-
-
Save chrismo/d43fcfe02e2baf7e71d1 to your computer and use it in GitHub Desktop.
Revisions
-
chrismo revised this gist
Jun 8, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -34,3 +34,9 @@ end puts BoatCar.new.vroom puts CarBoat.new.vroom puts EnhancedCar.new.vroom ### <car noise> <boat noise> <enhanced <car noise>> -
chrismo created this gist
Jun 8, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ module Car def vroom '<car noise>' end end module Boat def vroom '<boat noise>' end end module Enhancer def vroom "<enhanced #{super}>" end end class CarBoat include Car include Boat end class BoatCar include Boat include Car end class EnhancedCar include Car include Enhancer end puts BoatCar.new.vroom puts CarBoat.new.vroom puts EnhancedCar.new.vroom