This could be:

```ruby
(hash[TAG] || {}).each do |tag, content|
```