Module: DataModeler::Model

Defined in:
lib/data_modeler/model/selector.rb

Overview

All models for the framework should belong to this module. Also includes a model selector for initialization from config.

Defined Under Namespace

Classes: FANN

Class Method Summary collapse

Class Method Details

.selector(type:, **opts) ⇒ Model

Returns a new ‘Model` based on the `type` of choice initialized

with `opts` parameters

Parameters:

  • type (Symbol)

    selects the type of ‘Model`

  • opts (**Hash)

    the rest of the parameters will be passed to the model for its initialization

Returns:

  • (Model)

    an initialized ‘Model` of type `type`



11
12
13
14
15
16
17
# File 'lib/data_modeler/model/selector.rb', line 11

def self.selector type:, **opts
  case type
  when :fann
    FANN.new opts
  else abort "Unrecognized model: #{type}"
  end
end