String class extended with camelcase method

This commit is contained in:
onyx-and-iris 2023-07-15 00:17:09 +01:00
parent 24edb0b134
commit 35355fb31c

View File

@ -0,0 +1,14 @@
module Voicemeeter
module Ext
module String
module CamelCase
class ::String
def camelcase
self if self !~ /_/ && self =~ /[A-Z]+.*/
split("_").map { |e| e.capitalize }.join
end
end
end
end
end
end