Module: Mongify::Translation::Printer

Included in:
Mongify::Translation
Defined in:
lib/mongify/translation/printer.rb

Overview

Actually runs the translation from sql to no sql

Instance Method Summary collapse

Instance Method Details

Outputs a translation into a string format



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/mongify/translation/printer.rb', line 8

def print
  ''.tap do |output|
    all_tables.each do |t|
      output << %Q[table "#{t.name}" do\n]
        t.columns.each do |c|
          output << "\t#{c.to_print}\n"
        end
      output << "end\n\n"
    end
  end
end