Well, it looks to me like you have an outer hash with key/values, and a
value is an array of hashes, so you would do this:
main_hash["items"][1]["title"] ==> 'xyz'
main_hash["items"][1]["title"] ==> 'xyz'
^ ^
| |
array |
|
I already parsed the json call. The idea is that i want to access a
certain hash within :item => [] or return the slug value for title =>
"xyz"
On Sep 5, 7:39 pm, Everaldo Gomes wrote:
> Take a look at this,http://developer.yahoo.com/ruby/ruby-json.html
>
>
>
>
>
>
>
> On Mon, Sep 5, 2011 at 1:35
Take a look at this, http://developer.yahoo.com/ruby/ruby-json.html
On Mon, Sep 5, 2011 at 1:35 PM, 7stud -- wrote:
> That isn't valid ruby syntax. Are you trying to parse a file with that
> syntax?
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you a
my_array.select{|item| item[:key] == my_criterion}
..will give you an array of items that meet your needs if the 'item'
is a hash.
On Sep 5, 12:35 pm, 7stud -- wrote:
> That isn't valid ruby syntax. Are you trying to parse a file with that
> syntax?
>
> --
> Posted viahttp://www.ruby-forum.com/
That isn't valid ruby syntax. Are you trying to parse a file with that
syntax?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroup
5 matches
Mail list logo