Module: Nidyx::Generator

Extended by:
Generator
Included in:
Generator
Defined in:
lib/nidyx/generator.rb

Instance Method Summary collapse

Instance Method Details

#run(schema_path, options) ⇒ Object

The Nidyx model generator. Called by the Nidyx CLI. Parses the input schema, creates models and writes them to the output directory.

Parameters:

  • schema_path (String)

    Path to the schema to generate models with.

  • options (Hash)

    Model generation options hash.



14
15
16
17
18
19
# File 'lib/nidyx/generator.rb', line 14

def run(schema_path, options)
  schema = Nidyx::Reader.read(schema_path)
  raw_models = Nidyx::Parser.parse(schema, options)
  models = Nidyx::Mapper.map(raw_models, options)
  Nidyx::Output.write(models, options[:output_directory])
end