Class: Voicemeeter::Configs::Loader
- Inherits:
-
Object
- Object
- Voicemeeter::Configs::Loader
- Includes:
- Logging
- Defined in:
- lib/voicemeeter/configs.rb
Instance Attribute Summary collapse
-
#configs ⇒ Object
readonly
Returns the value of attribute configs.
Instance Method Summary collapse
-
#initialize(kind) ⇒ Loader
constructor
A new instance of Loader.
- #run ⇒ Object
- #to_s ⇒ Object
Methods included from Logging
Constructor Details
#initialize(kind) ⇒ Loader
Returns a new instance of Loader.
78 79 80 81 82 83 84 |
# File 'lib/voicemeeter/configs.rb', line 78 def initialize(kind) @kind = kind @configs = Hash.new do |hash, key| raise Errors::VMError.new "unknown config '#{key}'. known configs: #{hash.keys}" end @filereader = FileReader.new(kind) end |
Instance Attribute Details
#configs ⇒ Object (readonly)
Returns the value of attribute configs.
76 77 78 |
# File 'lib/voicemeeter/configs.rb', line 76 def configs @configs end |
Instance Method Details
#run ⇒ Object
90 91 92 93 94 95 |
# File 'lib/voicemeeter/configs.rb', line 90 def run logger.debug "Running #{self}" configs[:reset] = TOMLConfBuilder.run(@kind) @filereader.each(&method(:register)) self end |
#to_s ⇒ Object
86 87 88 |
# File 'lib/voicemeeter/configs.rb', line 86 def to_s "Loader #{@kind}" end |