"false"}] How to...">All geek questions in one placeAdd hash to array?I have this hash:{:residential=>"false"} But I need to make this an array element: [{:residential=>"false"}] How to do it?+6arrays ruby hashShpigford Aug 30 '11 at 16:50source share2 answers my_array = [] my_array << {:residential => "false"} => [{:residential=>"false"}] +16mhoofman Aug 30 '11 at 16:58source shareThe code you already wrote should be fine. >> x = [{:residental=>"false"}, {:residental=>"true"}] => [{:residental=>"false"}, {:residental=>"true"}] >> x[0][:residental] => "false" +3Mitch lindgren Aug 30 '11 at 16:56source shareSource: https://habr.com/ru/post/896229/More articles:Creating a two-dimensional polygon in XNA - c #htaccess QUERY_STRING urldecode - query-stringSynchronize DateTime with a known but not set time zone - timezoneAnimating a polygon drawn with vertices - polygonAutomatically update the watchlist when changing - knockoutjs & jQuery Mobile - jqueryrewrite and decrypt URL - urlhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/896231/why-copying-to-system32-automatically-copies-to-syswow64-instead&usg=ALkJrhiq-Pq5C6HJDBRGHYPajb-jKVVIPADictionary search with Linq - dictionaryCan Jenkins build Eclipse projects? - javaRequest a specific message privacy setting for a single application - phpAll Articles
I have this hash:
{:residential=>"false"}
But I need to make this an array element:
[{:residential=>"false"}]
How to do it?
my_array = [] my_array << {:residential => "false"} => [{:residential=>"false"}]
The code you already wrote should be fine.
>> x = [{:residental=>"false"}, {:residental=>"true"}] => [{:residental=>"false"}, {:residental=>"true"}] >> x[0][:residental] => "false"
Source: https://habr.com/ru/post/896229/More articles:Creating a two-dimensional polygon in XNA - c #htaccess QUERY_STRING urldecode - query-stringSynchronize DateTime with a known but not set time zone - timezoneAnimating a polygon drawn with vertices - polygonAutomatically update the watchlist when changing - knockoutjs & jQuery Mobile - jqueryrewrite and decrypt URL - urlhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/896231/why-copying-to-system32-automatically-copies-to-syswow64-instead&usg=ALkJrhiq-Pq5C6HJDBRGHYPajb-jKVVIPADictionary search with Linq - dictionaryCan Jenkins build Eclipse projects? - javaRequest a specific message privacy setting for a single application - phpAll Articles