Class: Rmsgen::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/rmsgen/runtime.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Runtime

Returns a new instance of Runtime.



4
5
6
7
8
9
10
# File 'lib/rmsgen/runtime.rb', line 4

def initialize(config)
  @config = config
  raise "Ensure you have populated a config file" unless @config
  @output = config['output_file']
  @notes = PolnoteGroup.fetch(polnote_source)
  run!
end

Instance Method Details

#run!Object



12
13
14
15
16
17
18
19
20
# File 'lib/rmsgen/runtime.rb', line 12

def run!
  puts 'no polnotes in queue' if @notes.empty?
  @notes.each do |note|
    system('clear')
    polnote = Rmsgen::Polnote.new(:body => note)
    Rmsgen::Inquirer.inquire_about_note(polnote)
    write(polnote)
  end
end