Skip to content

Instantly share code, notes, and snippets.

@ph3nx
Created January 21, 2014 21:58
Show Gist options
  • Save ph3nx/8549256 to your computer and use it in GitHub Desktop.
Save ph3nx/8549256 to your computer and use it in GitHub Desktop.
Ruby example that explains the usage of Proc's.
floats = [1.2, 3.45, 0.91, 7.727, 11.42, 482.911]
# Write your code below this line!
round_down = Proc.new { |f| f.floor }
# Write your code above this line!
ints = floats.collect(&round_down)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment