find would be better here IMO

```ruby
ranges.find { |r| r[:range].include?(score) }[:name] || 'critical'
```