mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-22 01:40:49 +00:00
we already know valid params
so we can set instance variabels dynamically
This commit is contained in:
parent
54e255535f
commit
23ac1b670c
@ -609,7 +609,7 @@ p vm.event.get
|
|||||||
|
|
||||||
### Remote class
|
### Remote class
|
||||||
|
|
||||||
#### Voicemeeter.remote
|
#### Voicemeeter::Remote
|
||||||
|
|
||||||
You may pass the following optional keyword arguments:
|
You may pass the following optional keyword arguments:
|
||||||
|
|
||||||
|
@ -31,13 +31,12 @@ module Voicemeeter
|
|||||||
|
|
||||||
attr_reader :pdirty, :mdirty, :midi, :ldirty
|
attr_reader :pdirty, :mdirty, :midi, :ldirty
|
||||||
|
|
||||||
def initialize(pdirty: false, mdirty: false, midi: false, ldirty: false)
|
def initialize(**kwargs)
|
||||||
make_writer_methods :pdirty, :mdirty, :midi, :ldirty
|
make_writer_methods :pdirty, :mdirty, :midi, :ldirty
|
||||||
|
|
||||||
self.pdirty = pdirty
|
kwargs.each do |key, value|
|
||||||
self.mdirty = mdirty
|
instance_variable_set("@#{key}", value || false)
|
||||||
self.midi = midi
|
end
|
||||||
self.ldirty = ldirty
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
|
Loading…
Reference in New Issue
Block a user