“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay...”

Rob Lacey (contact@robl.me)
Senior Software Engineer, Brighton, UK

Ruby objects and no dup-ing.

Got to remember that when you pass an object to method, that the object is still the same object in memory and it change the object in memory changes, leading to potentially unexpected behaviour. So if you really need to manipulate the arguments a method receives, perhaps think about call blah.dup to clone it before you make changes to it.

options = { :node => 'MyNodeThing' }

def url(options)
  node = options.delete(:node)
  puts node
end

url(options)

puts options[:node]
#=> nil