Skip to content

Instantly share code, notes, and snippets.

@dliggat
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dliggat/283bdc15043bb09c7d51 to your computer and use it in GitHub Desktop.
Save dliggat/283bdc15043bb09c7d51 to your computer and use it in GitHub Desktop.
Module function collision => super calls most recent definition
module Foo
def blar
puts 'blar!'
end
end
module Bar
def blar
puts 'barry!'
end
end
class Flab
include Foo
include Bar
def blar
super
puts 'floob'
end
end
puts Flab.new.blar
# $ ruby ./mixin.rb
# barry!
# floob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment