ActiveSupport::Concernモジュール内にプライベートクラスメソッドを書く際に少し詰まったのでメモしておきます。
sample_class_method
はプライベートクラスメソッドとして扱うことが出来ます。
module Sample
extend ActiveSupport::Concern
included do
private_class_method :sample_class_method
end
class_methods do
def sample_class_method
puts 'hello world!'
end
end
private
def private_instance_method
puts 'hello world!'
end
end