app/helpers/auth_helper.rb
Use module_function
instead of extend self
. Open
Open
extend self
- Read upRead up
- Exclude checks
This cop checks for use of extend self
or module_function
in a
module.
Supported styles are: modulefunction, extendself.
Example: EnforcedStyle: module_function (default)
# bad
module Test
extend self
# ...
end
# good
module Test
module_function
# ...
end
In case there are private methods, the cop won't be activated. Otherwise, it forces to change the flow of the default code.
Example: EnforcedStyle: module_function (default)
# good
module Test
extend self
# ...
private
# ...
end
Example: EnforcedStyle: extend_self
# bad
module Test
module_function
# ...
end
# good
module Test
extend self
# ...
end
These offenses are not safe to auto-correct since there are different implications to each approach.