mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2024-11-15 18:50:47 +00:00
use Kernel#Array
This commit is contained in:
parent
587e861bbe
commit
7cf05fbe08
@ -40,12 +40,12 @@ module OBSWS
|
||||
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