mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-15 15:00:46 +00:00
switch send for public_send
This commit is contained in:
parent
350ebdd444
commit
42baa543fc
@ -207,9 +207,9 @@ module Voicemeeter
|
|||||||
data.each do |key, hash|
|
data.each do |key, hash|
|
||||||
case key.to_s.split("-")
|
case key.to_s.split("-")
|
||||||
in [/strip|bus|button/ => kls, /^[0-9]+$/ => index]
|
in [/strip|bus|button/ => kls, /^[0-9]+$/ => index]
|
||||||
target = send(kls)
|
target = public_send(kls)
|
||||||
in ["vban", /in|instream|out|oustream/ => dir, /^[0-9]+$/ => index]
|
in ["vban", /in|instream|out|oustream/ => dir, /^[0-9]+$/ => index]
|
||||||
target = vban.send("#{dir.chomp("stream")}stream")
|
target = vban.public_send("#{dir.chomp("stream")}stream")
|
||||||
else
|
else
|
||||||
raise KeyError, "invalid config key '#{key}'"
|
raise KeyError, "invalid config key '#{key}'"
|
||||||
end
|
end
|
||||||
|
@ -37,12 +37,12 @@ module Voicemeeter
|
|||||||
def apply(params)
|
def apply(params)
|
||||||
params.each do |key, val|
|
params.each do |key, val|
|
||||||
if val.is_a? Hash
|
if val.is_a? Hash
|
||||||
target = send(key)
|
target = pulic_send(key)
|
||||||
target.apply(val)
|
target.apply(val)
|
||||||
elsif key == :mode
|
elsif key == :mode
|
||||||
mode.send("#{val}=", true)
|
mode.pulic_send("#{val}=", true)
|
||||||
else
|
else
|
||||||
send("#{key}=", val)
|
pulic_send("#{key}=", val)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user