mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-23 10:20:49 +00:00
move attr_reader into macro method
This commit is contained in:
parent
891667cc3b
commit
59cda8aca6
@ -28,8 +28,10 @@ module Voicemeeter
|
|||||||
include Logging
|
include Logging
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
private def attr_events(*params)
|
private def attr_accessor_events(*params)
|
||||||
params.each do |param|
|
params.each do |param|
|
||||||
|
attr_reader param
|
||||||
|
|
||||||
define_method("#{param}=") do |value|
|
define_method("#{param}=") do |value|
|
||||||
instance_variable_set("@#{param}", value)
|
instance_variable_set("@#{param}", value)
|
||||||
info("#{param} #{value ? "added to" : "removed from"}")
|
info("#{param} #{value ? "added to" : "removed from"}")
|
||||||
@ -38,8 +40,7 @@ module Voicemeeter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :pdirty, :mdirty, :midi, :ldirty
|
attr_accessor_events :pdirty, :mdirty, :midi, :ldirty
|
||||||
attr_events :pdirty, :mdirty, :midi, :ldirty
|
|
||||||
|
|
||||||
def initialize(**kwargs)
|
def initialize(**kwargs)
|
||||||
kwargs.each do |key, value|
|
kwargs.each do |key, value|
|
||||||
|
Loading…
Reference in New Issue
Block a user