In the introduction to Ruby section which covers classes, there is a class method example:
... def self.find_all_unpaid self.where('paid=0') end ...
A bit later in the text, we are given the example of calling this method:
to_collect = Order.find_all_unpaid
If I’m following this, a class method would fire for each instance of the Order object, but I am unclear on how the method structures the return value in this particular case. If I understand correctly, each method without a specified return value returns the last expression evaluated.
Would the result here be an array or a hash of each instance that meets the conditions set in the method?