mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-21 17:30:49 +00:00
use Kernel#Array in register,deregister
This commit is contained in:
parent
a3523eeb40
commit
5307bebea8
@ -10,12 +10,12 @@ module Voicemeeter
|
||||
end
|
||||
|
||||
def register(cbs)
|
||||
cbs = [cbs] unless cbs.respond_to? :each
|
||||
cbs = Array(cbs) unless cbs.respond_to? :each
|
||||
cbs.each { |cb| on(cb.name[3..].to_sym, cb) }
|
||||
end
|
||||
|
||||
def deregister(cbs)
|
||||
cbs = [cbs] unless cbs.respond_to? :each
|
||||
cbs = Array(cbs) unless cbs.respond_to? :each
|
||||
cbs.each { |cb| observers[cb.name[3..].to_sym]&.reject! { |o| cbs.include? o } }
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user