refactor loaders.

run now returns reference to self
This commit is contained in:
onyx-and-iris 2023-07-30 14:33:59 +01:00
parent f60b7d6622
commit 1a3192324d

View File

@ -75,6 +75,7 @@ module Voicemeeter
logger.debug "Running #{self}"
configs[:reset] = build_reset_profile
read_from_yml
self
end
end
@ -124,8 +125,7 @@ module Voicemeeter
def get(kind_id)
unless defined? @loaders
@loaders = Kinds::ALL.to_h { |kind| [kind.name, Loader.new(kind)] }
@loaders.each { |name, loader| loader.run }
@loaders = Kinds::ALL.to_h { |kind| [kind.name, Loader.new(kind).run] }
end
@loaders[kind_id].configs
end