Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Mod
- def foo(x)
- x**2
- end
- end
- module Mod2
- def foo(x)
- x*2
- end
- end
- class A
- include Mod
- def foo(x)
- super(x) + 1
- end
- end
- A.new.foo(5) == 26 # true
- class A
- include Mod2
- def foo(x)
- super(x) + 1
- end
- end
- A.new.foo(5) == 11 # true
- class A
- include Mod
- def foo(x)
- super(x) + 1
- end
- end
- A.new.foo(5) == 26 # false. Is 11
- class A
- include Mod
- def foo(x)
- super(x) + 1
- end
- include Mod2
- def foo(x)
- super(x) + 1
- end
- include Mod
- def foo(x)
- super(x) + 1
- end
- end
- class A
- include Mod
- def foo(x)
- super(x) + 1
- end
- end
- A.new.foo(5) == 26 # true
- class A
- include Mod2
- end
- A.new.foo(5) == 11 # true
- class A
- include Mod
- end
- A.new.foo(5) == 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement