Skip to content

Commit

Permalink
Change the Extensions module to use alias instead of alias_method
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Nov 12, 2023
1 parent 34e4fd1 commit 0295a89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions lib/strings/case/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 0295a89

Please sign in to comment.