Skip to content

Instantly share code, notes, and snippets.

@coffeejay
Created March 26, 2019 02:38
Show Gist options
  • Save coffeejay/390a62943c0e26cf44704900ad7e1c90 to your computer and use it in GitHub Desktop.
Save coffeejay/390a62943c0e26cf44704900ad7e1c90 to your computer and use it in GitHub Desktop.
json = response.parsed_response
matchup = json.select { |s| s["Week"] == week.to_s && (s["team_1_name"] == @player.team || s["team_2_name"] == @player.team) }
matchup.each { |h| h.each { |k,v| game_ids << v if v && /game_\d_id/ =~ k } }
is_final = matchup.length > 0 && matchup.first["winning_team_id"].present?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment