-
- Notifications
You must be signed in to change notification settings - Fork 284
Open
Labels
feature requestRequest for new functionalityRequest for new functionality
Description
Is your feature request related to a problem? Please describe.
When using #delegate
, ActiveSupport creates a new method on the class, but this method does not respect the visibility scope of said class.
For example:
class Foo def initialize(bar) @bar = bar end attr_reader :bar private delegate :baz, to: :bar end
The generated method #baz
will not be private. The #delegate
method does, however, provide an option to create a private method like so:
delegate :baz, to: :bar, private: true
Describe the solution you'd like
I would like a cop that detects calls to #delegate
that:
- Are in a
private
scope. - Does not pass the
private: true
option.
Darhazer and BenKanouseABaldwinHunter and BenKanouse
Metadata
Metadata
Assignees
Labels
feature requestRequest for new functionalityRequest for new functionality