mardi 24 janvier 2017

Is a bad pratice to use long method name in ruby/rails?

I have the following service class in ruby:

class EnableUserMatriculations

  def initialize(user)
    @user = user
  end

  def call!
    matriculations_that_current_user_is_matriculated_and_confirmed.each do |matriculation|
      matriculation.enable!
    end
  end


  private

  def matriculations_that_current_user_is_matriculated_and_confirmed
    # some logic to search user.matriculations that must be enabled
  end
end

And I would like to know if methods with long names is a bad pratice?

I dont like to use comments.

Please, give me opinions about this.

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire