Skip to content

@benweint /test.rb
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Demonstration of behavior difference between Ruby 1.9.3 and 2.0+
module A
def foo
puts "foo from A"
end
end
class B
include A
def foo
puts "foo from B"
super
end
end
class C < B
alias_method :orig_foo, :foo
def foo
puts "foo from C"
orig_foo
end
end
class B
alias_method :orig_foo, :foo
def foo
puts "foo from B (again)"
orig_foo
end
end
C.new.foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.