Skip to content

Instantly share code, notes, and snippets.

@launchkit-codes
Created March 20, 2015 10:44
Show Gist options
  • Select an option

  • Save launchkit-codes/be420735e95cc656261a to your computer and use it in GitHub Desktop.

Select an option

Save launchkit-codes/be420735e95cc656261a to your computer and use it in GitHub Desktop.
What's closure concept?
def add(a)
return Proc.new do |b|
a + b
end
end
addition = add(4)
puts addition.call(5) # => 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment