It is quite hard to recognize what this should be. If I get it properly, you want add empty string if list is empty, right?
then native ruby code looks much readable for me:
```
ip_list = [""] if ip_list.empty?
```