@judofyr Nice. I'd like to order by importance or relatedness but I find those criteria are hard to determine in practice, resulting in random-ish ordering, so I stick with alphabetical.

I ask bc I'm working on a rubocop extension for ordering methods (github.com/shanecav84/rubocop-) and want to see where the community is at. The cop currently only supports alphabetical ordering but I'd like to add config to check for ordering by invocation sequence.

How does everyone order their methods in a class?

# Alphabetical
def a; end
def b; end

# Importance
def business_logic; end
def utility_method; end

# Invocation sequence
def call
called_first
called_second
end

def called_first; end
def called_second; end

Ruby.social

A Mastodon instance for Rubyists & friends