In the following code:
If i wanted to get the value of :a ("apple") I would use "hash[:a]". If I wanted to get the key for "apple" (:a) I would use hash.key("apple").
But how can i return a hash value pair?
hash = {:a => "apple", :b => "banana"}
e.g. check if the hash contains :a, and if it does return the following
=> {:a => "apple"}
thanks.