You can rewrite this condition:
```
if response[:data][:out] and response[:data][:out].any?
```
Ruby returns Nil if no key in dict.