Skip to content

Instantly share code, notes, and snippets.

@edezekiel
Created November 5, 2018 18:50
Show Gist options
  • Save edezekiel/c6e32b9d6188ef13e2ac03a526621d14 to your computer and use it in GitHub Desktop.
Save edezekiel/c6e32b9d6188ef13e2ac03a526621d14 to your computer and use it in GitHub Desktop.
Using Pry in Loops
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