mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-22 01:40: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
|
end
|
||||||
|
|
||||||
def register(cbs)
|
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) }
|
cbs.each { |cb| on(cb.name[3..].to_sym, cb) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def deregister(cbs)
|
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 } }
|
cbs.each { |cb| observers[cb.name[3..].to_sym]&.reject! { |o| cbs.include? o } }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user