Maybe the cleanest solution would be to pass specific current local variable to erb template instead of passing the entire binding. It's possible with ERB#result_with_hash method (introduced in Ruby 2.5)
DATA.keys.each do |current|
result = template.result_with_hash(current: current)
...