Skip to content

Instantly share code, notes, and snippets.

@foreseaz
Created June 6, 2016 03:34
Show Gist options
  • Save foreseaz/46f83e0239dd5c239fa91766aad14b51 to your computer and use it in GitHub Desktop.
Save foreseaz/46f83e0239dd5c239fa91766aad14b51 to your computer and use it in GitHub Desktop.
ruby notes
# 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