Skip to content

Instantly share code, notes, and snippets.

@simandebvu
Created June 2, 2020 17:23
Show Gist options
  • Save simandebvu/3edc73eb9f6a666cf1594ad27a67edb9 to your computer and use it in GitHub Desktop.
Save simandebvu/3edc73eb9f6a666cf1594ad27a67edb9 to your computer and use it in GitHub Desktop.
Ruby Block Call
def my_awesome_method ("Param1", &block)
return to_enum(:each) unless block
i = 0
while i < size:
block.call at (i)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment