Class: Trinamo::OptionConverter

Inherits:
BaseConverter show all
Defined in:
lib/trinamo/converter/option_converter.rb

Instance Attribute Summary

Attributes inherited from BaseConverter

#ddl, #ddl_yaml_path

Instance Method Summary collapse

Methods inherited from BaseConverter

#initialize

Constructor Details

This class inherits a constructor from Trinamo::BaseConverter

Instance Method Details

#convertObject



5
6
7
8
9
10
11
12
13
# File 'lib/trinamo/converter/option_converter.rb', line 5

def convert
  options = @ddl[:options] ? @ddl[:options] : {}

  queries = options.keys.map do |key|
    options[key] ? "SET #{key} = #{options[key]};" : nil
  end

  queries.compact.join("\n")
end