mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2026-04-18 21:43:32 +00:00
remove the monkey patching
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user