In Rails, from time to time, you may encounter you have a method you call several times, but which returns always the same result. For example, have the following:
This will return the @approved_articles value if it exists. If it doesn't, which is the first time you access the method, the query is run and stored in @approved_articles for later use.
Note: I know it's much easier to define this kind of behaviour, but it's just an illustration.