If prefer this format since your condition is quite long:

```ruby
rule = HashWithIndifferentAccess.new(rule)

if rule[:host] == request.host && rule[:from] == request.path_info
  return rule
end
```