Question

I'm trying to access a hash with all the values for each connection. Right now, it's connections.values[1] in order to bypass _total.

enter image description here

There are certain cases when _total doesn't show up for certain ppl, thus rendering the code above invalid.

I also tried connections.values by that spits out the value 450 instead off the actual connections. How do I make sure to ignore _total : 450 in cases that it does appear and just access the persons information instead?

Was it helpful?

Solution

I think the problem lies in that the key name is "values" hash.values actually returns the values of a hash and that's an internal Ruby hash method.

Try using connections[:values] instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top