This could just be:

```ruby
response  response.detect { |segment| segment['id'] == id }
```