Class: RuboCop::Cop::ViewComponent::PreferPrivateMethods
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::ViewComponent::PreferPrivateMethods
- Includes:
- Base, TemplateAnalyzer
- Defined in:
- lib/rubocop/cop/view_component/prefer_private_methods.rb
Overview
Suggests making helper methods private in ViewComponents.
Constant Summary collapse
- MSG =
"Consider making `%<method_name>s` private. " \ "Only ViewComponent interface methods should be public."
Instance Method Summary collapse
Methods included from TemplateAnalyzer
#extract_method_calls, #template_paths_for
Methods included from Base
#enclosing_class, #inside_view_component?, #view_component_class?, #view_component_parent?
Instance Method Details
#on_class(node) ⇒ Object
34 35 36 37 38 |
# File 'lib/rubocop/cop/view_component/prefer_private_methods.rb', line 34 def on_class(node) return unless view_component_class?(node) check_public_methods(node) end |