I'm fairly new to Ruby and rails so I'm not quite sure how to do things "the right way" but I have several methods from Rspec (get, post, put, delete) that I would like to pass into an array so I can loop over them to execute the same code each time. I thought that'd be fairly easy but I can't figure out how to do it.
Does anyone know if that's possible, good practice, and how to do it?
['get', 'post', 'put', 'delete'].each {|m| obj.send(m) }
I see things done this way frequently in Ruby projects.