-
-
Save anonymous/b3ac5ba82a709c98474c604139710550 to your computer and use it in GitHub Desktop.
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
arr = [ | |
{"id"=>10569, "home_team_record"=>"1-2", "away_team_record"=>"2-2", "home_team_score"=>47, "away_team_score"=>40, "progress"=>"14:21 - 2nd", "state"=>"in"}, | |
{"id"=>8987, "home_team_record"=>"1-3", "away_team_record"=>"0-0", "home_team_score"=>87, "away_team_score"=>49, "progress"=>"6:43 - 2nd", "state"=>"in"} | |
] | |
# This is a summarized array, which is much larger. | |
# Instead of iterating every time I want to select a game, e.g. arr.find{|game| game['id'] == 8987} | |
# I want to rearrange the structure so I can just do something like arr['id'] == 8987 ? | |
# If so, how do I rearrange the structure to look like that? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment