Please use `&&` instead of `and` and remove space between ! and response or just use `present?`
```ruby
if response[:data][:out].present?
```

One question: is it possible the situation when the response[:data] is nil?

If yes, you should also add check:

```ruby
if response[:data] && response[:data][:out].present?
```