My array of hash is like:
[
{:id=>"folder.cecb8eb83d90dbeb.CECB8EB83D90DBEB!107", :name=>"Folder 11", :type=>"folder"},
{:id=>"folder.cecb8eb83d90dbeb.CECB8EB83D90DBEB!105", :name=>"Pictures", :type=>"album"},
{:id=>"folder.cecb8eb83d90dbeb.CECB8EB83D90DBEB!113", :name=>"Public", :type=>"folder"},
{:id=>"folder.cecb8eb83d90dbeb.CECB8EB83D90DBEB!124", :name=>"sasd", :type=>"folder"},
{:id=>nil, :name=>nil, :type=>nil},
{:id=>nil, :name=>nil, :type=>nil},
{:id=>nil, :name=>nil, :type=>nil},
{:id=>nil, :name=>nil, :type=>nil},
{:id=>nil, :name=>nil, :type=>nil},
{:id=>nil, :name=>nil, :type=>nil},
{:id=>nil, :name=>nil, :type=>nil}
]
How can I remove nil values if in my hash id is nil?
nilvalue if my hashidisnil? doesn't make sense. You can remove values without removing keys. Perhaps you mean you want to remove all hasheshfor whichh[:id].nil? #=> true? If so, say so (and if your array isa, do you want to modifyaor return an array equal toawith some (hash) elements removed?), Be precise in all things Ruby!