C
cczona
Okay, I must just be too sleep-deprived to see it. Why is Hash.each
(and the other enumerables) returning nothing but nils when clearly
the hash is being populated?
$foo={'a' => '1', 'b'=> '2'}
puts $foo.length
puts $foo.nil?
puts $foo.keys
puts $foo.values
puts "\n\n"
$foo.each do |k, v|
print $k, " and ", $v, "\n\n" # returns 'nil and nil'
end
Thank you.
(and the other enumerables) returning nothing but nils when clearly
the hash is being populated?
$foo={'a' => '1', 'b'=> '2'}
puts $foo.length
puts $foo.nil?
puts $foo.keys
puts $foo.values
puts "\n\n"
$foo.each do |k, v|
print $k, " and ", $v, "\n\n" # returns 'nil and nil'
end
Thank you.