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.



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

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

Instance Method Details

#run!Object



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

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