You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code doesn't generate any RuboCop offenses, even though it has a redundant visibility modifier, in that there's a second private call.
# Example of a class with repeated private visibility modifiers
class MyClass
def foo
# This is public
bar
baz
end
private
def bar
# This is private
puts 'bar called'
end
# Redundant visibility modifier
private
def baz
# This is also private
puts 'baz called'
end
end
MyClass.new.foo
There should be a cop that generates an offense for the second private.
The text was updated successfully, but these errors were encountered:
The following code doesn't generate any RuboCop offenses, even though it has a redundant visibility modifier, in that there's a second
private
call.There should be a cop that generates an offense for the second
private
.The text was updated successfully, but these errors were encountered: