Skip to content

Instantly share code, notes, and snippets.

@rfunduk
Created July 16, 2009 16:11
Show Gist options
  • Save rfunduk/148507 to your computer and use it in GitHub Desktop.
Save rfunduk/148507 to your computer and use it in GitHub Desktop.
# http://use.perl.org/~Ovid/journal/39301
module MixinUpper
def a; 'A'; end
def b; 'B'; end
end
module MixinLower
def a; 'a'; end
def b; 'b'; end
end
module MixinUpperProxy
include MixinUpper
alias :upper_a :a
alias :upper_b :b
end
class Mixer
include MixinUpperProxy
include MixinLower
end
mixer = Mixer.new
puts mixer.a #=> a
puts mixer.b #=> a
puts mixer.upper_a #=> A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment