|class GroupersController < ApplicationController::Base|
|@grouper = Grouper.new(leader: current_member)|
|@grouper = grouper|
I've never understood this style—though it appears popular. There's seems to be no improvement over
That said, I think if it were truly just a function it'd be a bit strange since in Ruby you kind of rely on classes to provide semantic grouping.
The advantage is quite simple: At some point there might have to be some kind of state – this is where you'd then either convert all consumers of your
Simply put: Don't use class methods unless you really have to. Ruby is an OOP language so use OOP.
In this specific example you're right, there's no improvement. But if you were to add other methods beyond deliver, which also make use of