I have an erb template which generates the config file for an httpd.
It’s important that a particular location is written last (it is a catch all)
At the moment the code looks like
cluster.apps.each do |app|
# Render config
end
I’d like to overload the each method on the apps object to guarantee order. What’s the best place to start looking for how to do this?
If you want to overload it, you can do something like
So you can now do:
And with the current implementation above, it will yield all the elements(except the first one) in a row. The last yielded item is the first one that was shifted off.