use maps to create higher class variables

This commit is contained in:
onyx-and-iris 2023-07-14 01:46:46 +01:00
parent 520bab0fce
commit 06795329cc

View File

@ -16,23 +16,28 @@ module Voicemeeter
def initialize(kind, **kwargs) def initialize(kind, **kwargs)
super super
@strip = [] @strip = (0...kind.num_strip).map { |i| Strip::Strip.make(self, i) }
kind.num_strip.times { |i| @strip << Strip::Strip.make(self, i) } @bus = (0...kind.num_bus).map { |i| Bus::Bus.make(self, i) }
@bus = [] @button = (0...kind.num_buttons).map { |i| Button::Button.new(self, i) }
kind.num_strip.times { |i| @bus << Bus::Bus.make(self, i) }
@button = []
kind.num_buttons.times { |i| @button << Button::Button.new(self, i) }
@vban = Vban::Vban.new(self) @vban = Vban::Vban.new(self)
end end
def configs def configs
Configs.get(@kind.name) Configs.get(kind.name)
end
def run
login
yield if block_given?
logout
end end
end end
public public
def self.make(kind_id, **kwargs) def self.new(kind_id, **kwargs)
" "
Factory method for remotes Factory method for remotes