Created
January 21, 2014 21:58
-
-
Save ph3nx/8549256 to your computer and use it in GitHub Desktop.
Ruby example that explains the usage of Proc's.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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