How to reference domains by domain_id in template?

In my Kickstart template, I am looking to reference the domain in one of my
secondary interfaces. When executing <% @hosts.interfaces.inspect %> I
notice there is a 'domain_id' of presumably an index number. How would I
then cross-reference a presumed "domains"? variable to pull out what the
index's name is? I'm sure there's some ERB way to pull all variables, but
the answer thus far escapes me with my limited ERB experience. Thanks!

I'm working towards creating a puppet module that grabs from the API
output, as per