I have a hash that looks like this:
get_fru =
{"default_fru_device"=>
{:name=>"default_fru_device",
"chassis_type"=>"Other",
"board_manufacturer"=>"IBM",
"product_name"=>"System x3650 M4"
}
}
I know that if I wanted to get the value of product_name, I could simply do get_fru["default_fru_device"]["product_name"] which would, in this example, return System x3650 M4.
However, If I wanted to get the values IBM and System x3650 M4 and make them display as a single string that said IBM System x3650 M4, how would I go about achieving that?
"#{get_fru["default_fru_device"]["board_manufacturer"]} #{get_fru["default_fru_device"]["product_name"]}"+(concatenates when used with String):my_string = get_fru["default_fru_device"]["board_manufacturer"]} + " " + get_fru["default_fru_device"]["product_name"]. But @EricDuminil's answer is great.