I have a method that returns the hash map { :name => "Test", :desc => "Test Description } . It will always return :name and :description .
How can I assign 2 variables in the returned hash.
I could do this, but it will call the method twice:
@name, @desc = get_name_desc_map[:name], get_name_desc_map[:desc]
I want to call the method only once.
source share