I'm changing local variable params
in some_method
:
def some_method params
params.object_id # => 70163816155080
params[:name] = 'bar'
params.object_id # => 70163816155080 Why is this not changing after I changed the value?
end
details = {name: 'foo'}
details.object_id # => 70163816155080
some_method details
details # => {:name=>"bar"}
Why is it changing the original variable details
? Does Ruby use pass by reference for hash?