G
Greg Hauptmann
[Note: parts of this message were removed to make it a legal post.]
Hi,
Getting confused with Hashes a bit. It seems sometimes I can use both a
Symbol or a String to get the value back, but other times the Symbol doesn't
work. Is there any rule re how to remember how Hash handles setting and
getting values uses Symbol / String?
e.g. hash_variable[:amount] versus hash_variable["amount"]
e.g. hash_var = {:amount => 10}, versus hash_var = {"amount" => 10)
Hi,
Getting confused with Hashes a bit. It seems sometimes I can use both a
Symbol or a String to get the value back, but other times the Symbol doesn't
work. Is there any rule re how to remember how Hash handles setting and
getting values uses Symbol / String?
e.g. hash_variable[:amount] versus hash_variable["amount"]
e.g. hash_var = {:amount => 10}, versus hash_var = {"amount" => 10)