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
|
||||
|
||||
#### Voicemeeter.remote
|
||||
#### Voicemeeter::Remote
|
||||
|
||||
You may pass the following optional keyword arguments:
|
||||
|
||||
|
@ -31,13 +31,12 @@ module Voicemeeter
|
||||
|
||||
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
|
||||
|
||||
self.pdirty = pdirty
|
||||
self.mdirty = mdirty
|
||||
self.midi = midi
|
||||
self.ldirty = ldirty
|
||||
kwargs.each do |key, value|
|
||||
instance_variable_set("@#{key}", value || false)
|
||||
end
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
Loading…
Reference in New Issue
Block a user