Created
June 6, 2016 03:34
-
-
Save foreseaz/46f83e0239dd5c239fa91766aad14b51 to your computer and use it in GitHub Desktop.
ruby notes
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
# notes 1 | |
# how Rails change_table works | |
# http://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatements/change_table | |
def functionA(a) | |
b = 2 | |
yield functionB(a,b) | |
end | |
def functionB(a, b) | |
a + b | |
end | |
puts functionA(1) {|t| t + 3 } # 1 + 2 + 3 = 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment