Skip to content

Instantly share code, notes, and snippets.

@timuruski
Created August 23, 2021 21:48
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 timuruski/8daf010ea0ae1b5cdb8bd21d1b84acb1 to your computer and use it in GitHub Desktop.
Save timuruski/8daf010ea0ae1b5cdb8bd21d1b84acb1 to your computer and use it in GitHub Desktop.
An example of private methods colliding in modules.
module Foo
def foo
blah
end
private def blah
"foo"
end
end
module Bar
def bar
blah
end
private def blah
"bar"
end
end
class Meep
include Foo
include Bar
end
puts Meep.new.foo # => "bar" 😱
puts Meep.new.bar # => "bar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment