From 780d3dad8500d80551341d6c30bdf0917c799245 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Fri, 6 Oct 2023 17:02:07 +0200 Subject: [PATCH] [CLEANUP] Use `module_function` to create module functions --- .rubocop_todo.yml | 8 -------- lib/page_title_helper.rb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ed0873b..3ccdb78 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -41,11 +41,3 @@ Rails/RootPathnameMethods: Style/MixinUsage: Exclude: - 'Rakefile' - -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle, Autocorrect. -# SupportedStyles: module_function, extend_self, forbidden -Style/ModuleFunction: - Exclude: - - 'lib/page_title_helper.rb' diff --git a/lib/page_title_helper.rb b/lib/page_title_helper.rb index 07dca0f..e3f0f4b 100644 --- a/lib/page_title_helper.rb +++ b/lib/page_title_helper.rb @@ -14,7 +14,7 @@ module PageTitleHelper # https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/interpolations.rb module Interpolations - extend self + module_function def self.interpolate(pattern, *args) instance_methods(false).sort.reverse.inject(pattern.to_s.dup) do |result, tag|