mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-22 01:40:49 +00:00
String class extended with camelcase method
This commit is contained in:
parent
24edb0b134
commit
35355fb31c
14
lib/voicemeeter/core_extensions/string/camelcase.rb
Normal file
14
lib/voicemeeter/core_extensions/string/camelcase.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user