Created
April 10, 2011 07:03
-
-
Save luckydev/912117 to your computer and use it in GitHub Desktop.
same as calling just super
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
def say_hi(a,b,c) | |
puts "Hi, from [A] module. Numbers - #{a} #{b} #{c}" | |
end | |
end | |
class B | |
include A | |
def say_hi(a,b,c) | |
puts "B is saying Hi.. " | |
# writing just super, will do the same thing as below | |
super(a,b,c) | |
end | |
end | |
b = B.new | |
b.say_hi(1,2,3) | |
#output | |
B is saying Hi.. | |
Hi, from [A] module. Numbers - 1 2 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment