Created
November 5, 2018 18:50
-
-
Save edezekiel/c6e32b9d6188ef13e2ac03a526621d14 to your computer and use it in GitHub Desktop.
Using Pry in Loops
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
def student_serial(i) | |
new_hash = {} | |
i.each_with_index do |value, index| | |
# we will add a conditional pry to | |
# start a session when our value is nil | |
binding.pry if value.nil? | |
new_hash["#{value}"] = index | |
end | |
new_hash | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment