add perenthesis in call()

This commit is contained in:
onyx-and-iris 2023-07-14 01:48:22 +01:00
parent 3e6fe5c443
commit ea57227b46

View File

@ -55,11 +55,11 @@ module Voicemeeter
def call(fn, *args, ok: [0], exp: nil) def call(fn, *args, ok: [0], exp: nil)
res = send(fn, *args) res = send(fn, *args)
if exp.nil? if exp.nil?
unless ok.include? res unless ok.include?(res)
raise Errors::VMCAPIError.new("#{fn} returned #{res}") raise Errors::VMCAPIError.new("#{fn} returned #{res}")
end end
else else
unless exp.call(res) unless exp.call(res) && ok.include?(res)
raise Errors::VMCAPIError.new("#{fn} returned #{res}") raise Errors::VMCAPIError.new("#{fn} returned #{res}")
end end
end end