Created
April 9, 2014 06:53
-
-
Save ukstudio/10233441 to your computer and use it in GitHub Desktop.
keyword args
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
def foo | |
:foo | |
end | |
def bar(foo = 1) | |
p foo #=> 1(2.1.1, 2.2.0) | |
end | |
def hoge(foo = foo) | |
p foo #=> :foo(2.1.1), nil(2.2.0) | |
end | |
def fuga(foo = foo()) | |
p foo #=> :foo(2.1.1, 2.2.0) | |
end | |
bar | |
hoge | |
fuga |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment