K
kazaam
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=>"http://en.wikipedia.org/wiki/Ruby"}, {:url=>"http://www.rubyonrails.org/"}, {:url=>"
"}, {:url=>"http://www.rubycentral.org/"}, {:url=>"http://www.zenspider.com/Languages/Ruby/QuickRef.html"}, {: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://en.wikipedia.org/wiki/Ruby_programming_language
http://en.wikipedia.org/wiki/Ruby
http://www.rubyonrails.org/
http://www.rubycentral.org/
http://www.zenspider.com/Languages/Ruby/QuickRef.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.
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=>"http://en.wikipedia.org/wiki/Ruby"}, {:url=>"http://www.rubyonrails.org/"}, {:url=>"
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://en.wikipedia.org/wiki/Ruby_programming_language
http://en.wikipedia.org/wiki/Ruby
http://www.rubyonrails.org/
http://www.zenspider.com/Languages/Ruby/QuickRef.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.