So I semi-asked this in another thread about how to get .max and return a value to a screen. All where very good answers, I just didn't ask the entire question. I ended up going with:
hash_example = {777 =>["dog","brown",3], 123=>["cat","orange",2]} #hash example
h =hash_example.values.collect{|a|a[0]}.max #change .max value based on element
puts the a[1] element based on what is returned in h because of .max of a[0].max
The problem is now I want to take h (the .max value found) and based on finding that element return a different element from the same array in the next line of code. To further elaborate lets say the above code found dog as .max. How do I go about returning brown or 3 to the screen in the next line of code?
puts hash_example.some_method_here{block of useful code using the h value} ?
I'm probably looking into this the wrong way or is it just a simple puts statment ? I've tried some nesting in the block but I'm definetly not nesting it correctly. .inject and .map I think are the right direction but I'm not writing the block correctly.