I need to loop through an aliases hash, and transform the header array by assigning it values from the aliases hash in a Ruby class.
I can't seem to transform the header array and then have it available after the loop.
How do I transform the header array so it is available for use after the loop?
header = ["City", "State"]
aliases = {"City"=>"Las Vegas", "State"=>"Nevada"}
aliases.each do |k,v|
header.each do |s|
if s == k then
s = v
end
end
end
puts header
s=vdoes not change the header.