remove the monkey patching

This commit is contained in:
2023-07-26 18:55:35 +01:00
parent d12a1a5954
commit 57fca646b5
3 changed files with 13 additions and 12 deletions

View File

@@ -1,12 +1,13 @@
module OBSWS
module Util
class ::String
def to_camel
split("_").map(&:capitalize).join
module String
def camelcase(s)
s.split("_").map(&:capitalize).join
end
def to_snake
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
def snakecase(s)
s
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
.downcase
end