New to ruby and I'm trying to create an array of hashes (or do I have it backwards?)
def collection
hash = { "firstname" => "Mark", "lastname" => "Martin", "age" => "24", "gender" => "M" }
array = []
array.push(hash)
@collection = array[0][:firstname]
end
@collection does not show the firstname for the object in position 0... What am I doing wrong?
Thanks in advance!