From: Nicole Villette Date: 2013-03-14T05:33:26+09:00 Subject: Re: Access values for JSON.parse response Nicole Villette wrote in post #1101455: > Joel Pearson wrote in post #1101386: >> By the way, I corrected this on the forum but it's still wrong in >> Matthew's quote and presumably the emails: >> >> This: >> if el.is_a?(Hash) || v.is_a?(Array) >> >> Should be this: >> if el.is_a?(Hash) || el.is_a?(Array) > > Thanks for your help. I like the idea of seeing the path. Joel, What I need to do is verify that specific values exist in the response. For example, I expect the duration to be 30. So in ruby I can use the following: val=recursive_select( "duration", parsed) assert_equal(30,val,"Item NOT found") Your function returns the following which is great because I need to be able to see all of the values for duration. value30pathTODAdBreaksAdBreak0duration value15pathTODAdBreaksAdBreak0Ad0duration value15pathTODAdBreaksAdBreak0Ad1duration Any suggestions on how I would go about verifying that duration is '30'? or duration is '15' in an assertion? Do I need to use the strip method to grab the values? I'm just trying to find the best way to handle this. Thanks again for your assistance. -- Posted via http://www.ruby-forum.com/.