Take a look at this,
puts myvalue.inspect
shows this here:
[{:url=>“http://www.ruby-lang.org/”},
{:url=>“http://www.ruby-lang.org/en/20020101.html”},
{:url=>“http://en.wikipedia.org/wiki/Ruby_programming_language”},
{:url=>“Ruby - Wikipedia”},
{:url=>“http://www.rubyonrails.org/”},
{:url=>“Kaiser Chiefs - Ruby - YouTube”},
{:url=>“http://www.rubycentral.org/”},
{:url=>“Ruby | zenspider.com | by ryan davis”},
{:url=>“http://www.rubycentral.com/book/”},
{:url=>“http://poignantguide.net/”}]
That’s an array of hashes or? But how to get this to an array of the
values of these hashes? Like my_new_array ==
[“http://www.ruby-lang.org/",“http://www.ruby-lang.org/en/20020101.html”,"http://en.wikipedia.org/wiki/Ruby_programming_language”,…].
myvalue.each {|arr| puts arr.values }
gives me:
http://www.ruby-lang.org/
http://www.ruby-lang.org/en/20020101.html
http://www.rubycentral.com/book/
http://poignantguide.net/
what’s correct! But I can’t save it to an array. Why? I tried
myvalue.each {|arr| @my_new_array << arr.values }
puts @my_new_array
But I just get nil ? I can’t make an array out of this.