Class: Sidtool::RubyFileWriter
- Inherits:
-
Object
- Object
- Sidtool::RubyFileWriter
- Defined in:
- lib/sidtool/ruby_file_writer.rb
Instance Method Summary collapse
-
#initialize(synths_for_voices) ⇒ RubyFileWriter
constructor
A new instance of RubyFileWriter.
- #write_to(path) ⇒ Object
Constructor Details
#initialize(synths_for_voices) ⇒ RubyFileWriter
Returns a new instance of RubyFileWriter.
3 4 5 |
# File 'lib/sidtool/ruby_file_writer.rb', line 3 def initialize(synths_for_voices) @synths_for_voices = synths_for_voices end |
Instance Method Details
#write_to(path) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/sidtool/ruby_file_writer.rb', line 7 def write_to(path) File.open(path, 'w') do |file| file.puts '::SYNTHS = [' @synths_for_voices.flatten.sort_by(&:start_frame).each do |synth| file.puts synth.to_a.inspect + ',' end file.puts ']' end end |