Skip to content

Instantly share code, notes, and snippets.

@ethe
Created December 9, 2019 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethe/cad17be3abf81935f61f20bd2937fc5c to your computer and use it in GitHub Desktop.
Save ethe/cad17be3abf81935f61f20bd2937fc5c to your computer and use it in GitHub Desktop.
def foo
cnt = 0
return lambda {
cnt += 1
return cnt
}
end
func = foo
puts func.call
puts func.call
puts func.call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment