In my app, we have Users who can perform actions on one another - like poking on Facebook.
I'm writing the methods just now and am not really sure which approach to take. I mean, I know they're both acceptable but is there a more idiomatic approach?
Option 1
if @current_user.may_poke?(@other_user)
@current_user.poke!(@other_user)
end
Option 2
if @current_user.may_poke?(@other_user)
@other_user.poke!(@current_user)
end
The first option reads better in English, almost perfectly as a sentence.
The second option makes more sense in terms of method naming, "poke" is a method being performed on the @other_user
. The @current_user
is just an argument to provide extra info - who did the poking.