Class: Trinamo::BaseConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/trinamo/converter/base_converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ddl_yaml_path, ddl = nil) ⇒ BaseConverter

Returns a new instance of BaseConverter.



8
9
10
11
12
13
14
15
# File 'lib/trinamo/converter/base_converter.rb', line 8

def initialize(ddl_yaml_path, ddl = nil)
  @ddl_yaml_path = ddl_yaml_path
  @ddl = if ddl
    ddl
  else
    ddl_yaml_path ? YAML.load_file(ddl_yaml_path).deep_symbolize_keys : nil
  end
end

Instance Attribute Details

#ddlObject

Returns the value of attribute ddl.



6
7
8
# File 'lib/trinamo/converter/base_converter.rb', line 6

def ddl
  @ddl
end

#ddl_yaml_pathObject

Returns the value of attribute ddl_yaml_path.



6
7
8
# File 'lib/trinamo/converter/base_converter.rb', line 6

def ddl_yaml_path
  @ddl_yaml_path
end

Instance Method Details

#convert(format) ⇒ Object



17
18
19
# File 'lib/trinamo/converter/base_converter.rb', line 17

def convert(format)
  Trinamo::Converter.load(@ddl_yaml_path, format, @ddl).convert
end