"The amateur imitates, the genius steals." Oscar WildeNever design what you can steal. Great advice! If you are a Ruby developer, where do you steal code?
Let's say, you are working on your webapp that needs to save where the user came from and you need to redirect them to that URL. The most popular authentication library is devise. Go to the github page for devise, read the wiki to see if there is any article that explains how to do it. Download the source code for devise and search for the method name that provides you that functionality. You can read the implementation and see how it is implemented. You can now do something similar for your webapp.