Skip to content

Instantly share code, notes, and snippets.

@toandv
Created September 13, 2015 17:18
Show Gist options
  • Save toandv/0ee106de4b367e3800bb to your computer and use it in GitHub Desktop.
Save toandv/0ee106de4b367e3800bb to your computer and use it in GitHub Desktop.
Ruby lambdas
sum = -> (a, b) {puts a + b}
sum.call(1 , 2)
def block1
lambda { return 100}.call
return :lambda
end
def block2
Proc.new { return :proc}.call
return 200
end
puts block1
puts block2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment