now using String refinement

Events Director module renamed

patch bump
This commit is contained in:
2023-08-29 22:55:11 +01:00
parent 3a0f298045
commit 4c4746fe8a
4 changed files with 19 additions and 17 deletions

View File

@@ -28,8 +28,8 @@ module OBSWS
ALL = LOW_VOLUME | HIGH_VOLUME
end
module EventDirector
include Util::String
module Director
using Util::CoreExtensions
def observers
@observers ||= {}
@@ -50,13 +50,13 @@ module OBSWS
end
def fire(event, data)
observers[snakecase(event).to_sym]&.each { |block| data.empty? ? block.call : block.call(data) }
observers[event.snakecase.to_sym]&.each { |block| data.empty? ? block.call : block.call(data) }
end
end
class Client
include Logging
include EventDirector
include Events::Director
include Mixin::TearDown
include Mixin::OPCodes