Why is that an instance variable here? It's not for caching, it's also used as return value, so not for other methods. If it's only for set_pagination_headers it should a parameter of it IMO.