I am not an expert of Ruby and I try to use elements from a string that was part of a big JSON message. I never been able to use JSON.parse for whatever reason but was able to find a way to loop over the object. But at the end, I have this remaining string that I don't know how to get the value:
{:time=>"2014-09-11 10:59:27 +0000", :cpu=>0.02421584874444766, :mem=>192069632, :disk=>635125760}
This is attached to a variable called appUsage. If I try appUsage["cpu"] I obtained: cpu. I have tried couple looping suggestion from research on Internet but I just don't know enough Ruby - I guess - to know the right one that will works.
P.S.: For those who would like to know where this "string" is coming from, this is the result that coming from the app.stats from the library of CFoundry.