From 0295a89bc903a57e83251c20e118675e0bd1f7f1 Mon Sep 17 00:00:00 2001 From: Piotr Murach Date: Sun, 12 Nov 2023 18:04:02 +0000 Subject: [PATCH] Change the Extensions module to use alias instead of alias_method --- CHANGELOG.md | 1 + lib/strings/case/extensions.rb | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cce68b2..ef4e31f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Change extensions to require core library when loaded * Change Strings::Case class to hide constants * Change Strings::Case class to hide instance method +* Change the Extensions module to use alias instead of alias_method ## [v0.3.0] - 2019-12-07 diff --git a/lib/strings/case/extensions.rb b/lib/strings/case/extensions.rb index 4760407..393da35 100644 --- a/lib/strings/case/extensions.rb +++ b/lib/strings/case/extensions.rb @@ -9,12 +9,12 @@ module Extensions def camelcase(*args, **options) Strings::Case.camelcase(self, *args, **options) end - alias_method :lower_camelcase, :camelcase + alias lower_camelcase camelcase def constcase(*args, **options) Strings::Case.constcase(self, *args, **options) end - alias_method :constantcase, :constcase + alias constantcase constcase def headercase(*args, **options) Strings::Case.headercase(self, *args, **options) @@ -23,12 +23,12 @@ def headercase(*args, **options) def kebabcase(*args, **options) Strings::Case.kebabcase(self, *args, **options) end - alias_method :dashcase, :kebabcase + alias dashcase kebabcase def pascalcase(*args, **options) Strings::Case.pascalcase(self, *args, **options) end - alias_method :upper_camelcase, :pascalcase + alias upper_camelcase pascalcase def pathcase(*args, **options) Strings::Case.pathcase(self, *args, **options) @@ -41,7 +41,7 @@ def sentencecase(*args, **options) def snakecase(*args, **options) Strings::Case.snakecase(self, *args, **options) end - alias_method :underscore, :snakecase + alias underscore snakecase def titlecase(*args, **options) Strings::Case.titlecase(self, *args, **options)