lib/getConstructor/index.js
function f_Constructor(ins_o) {
    var self = this;

    // Sanitize instance options
    if (!ins_o || typeof ins_o !== 'object') {
      ins_o = {};
    }
    if (!ins_o.custom_data || typeof ins_o.custom_data !== 'object') {
      ins_o.custom_data = {};
    }

    // Apply instance modules and properties
    for (var module_name in f_instance_modules) {
      /* istanbul ignore else  */
      if (f_instance_modules.hasOwnProperty(module_name)) {
        self['f_' + module_name] = f_instance_modules[module_name];
      }
    }

    // Apply instance options
    // Create data namespace, store name as f_data_namespace
    var data_namespace = con_o.data_namespace ||
      ins_o.data_namespace || 'data';
    self[data_namespace] = ins_o.custom_data;
    self.f_data_namespace = data_namespace;

    /** @TODO write desc for f_function_flow */
    self.f_function_flow = [];

    for (var property_name in f_instance_properties) {
      /* istanbul ignore else  */
      if (f_instance_properties.hasOwnProperty(property_name)) {
        self['f_' + property_name] = f_instance_properties[property_name];
      }
    }

    // Create instance function_flow, this in order to track tries
    con_o.function_flow.forEach(function (flow) {
      var new_flow_object = { tries: 0 };
      for (var property in flow) {
        /* istanbul ignore else  */
        if (flow.hasOwnProperty(property)) {
          if (property !== 'function') {
            new_flow_object[property] = flow[property];
          }
        }
      }
      self.f_function_flow.push(new_flow_object);
    });

    // Finaly, call user specified initializer and pass the instance options
    // custom data as the first argument
    if (con_o.initializer) {
      con_o.initializer.apply(self, [ins_o.custom_data]);
    }
  }
function f_Constructor(ins_o) {
    var self = this;

    // Sanitize instance options
    if (!ins_o || typeof ins_o !== 'object') {
      ins_o = {};
    }
    if (!ins_o.custom_data || typeof ins_o.custom_data !== 'object') {
      ins_o.custom_data = {};
    }

    // Apply instance modules and properties
    for (var module_name in f_instance_modules) {
      /* istanbul ignore else  */
      if (f_instance_modules.hasOwnProperty(module_name)) {
        self['f_' + module_name] = f_instance_modules[module_name];
      }
    }

    // Apply instance options
    // Create data namespace, store name as f_data_namespace
    var data_namespace = con_o.data_namespace ||
      ins_o.data_namespace || 'data';
    self[data_namespace] = ins_o.custom_data;
    self.f_data_namespace = data_namespace;

    /** @TODO write desc for f_function_flow */
    self.f_function_flow = [];

    for (var property_name in f_instance_properties) {
      /* istanbul ignore else  */
      if (f_instance_properties.hasOwnProperty(property_name)) {
        self['f_' + property_name] = f_instance_properties[property_name];
      }
    }

    // Create instance function_flow, this in order to track tries
    con_o.function_flow.forEach(function (flow) {
      var new_flow_object = { tries: 0 };
      for (var property in flow) {
        /* istanbul ignore else  */
        if (flow.hasOwnProperty(property)) {
          if (property !== 'function') {
            new_flow_object[property] = flow[property];
          }
        }
      }
      self.f_function_flow.push(new_flow_object);
    });

    // Finaly, call user specified initializer and pass the instance options
    // custom data as the first argument
    if (con_o.initializer) {
      con_o.initializer.apply(self, [ins_o.custom_data]);
    }
  }
function f_Constructor ( ins_o ) { var self = this ; // Sanitize instance options if ( ! ins_o || typeof ins_o !== 'object' ) { ins_o = { } ; } if ( ! ins_o . custom_data || typeof ins_o . custom_data !== 'object' ) { ins_o . custom_data = { } ; } // Apply instance modules and properties for ( var module_name in f_instance_modules ) { /* istanbul ignore else  */ if ( f_instance_modules . hasOwnProperty ( module_name ) ) { self [ 'f_' + module_name ] = f_instance_modules [ module_name ] ; } } // Apply instance options // Create data namespace, store name as f_data_namespace var data_namespace = con_o . data_namespace || ins_o . data_namespace || 'data' ; self [ data_namespace ] = ins_o . custom_data ; self . f_data_namespace = data_namespace ; /** @TODO write desc for f_function_flow */ self . f_function_flow = [ ] ; for ( var property_name in f_instance_properties ) { /* istanbul ignore else  */ if ( f_instance_properties . hasOwnProperty ( property_name ) ) { self [ 'f_' + property_name ] = f_instance_properties [ property_name ] ; } } // Create instance function_flow, this in order to track tries con_o . function_flow . forEach ( function ( flow ) { var new_flow_object = { tries : 0 } ; for ( var property in flow ) { /* istanbul ignore else  */ if ( flow . hasOwnProperty ( property ) ) { if ( property !== 'function' ) { new_flow_object [ property ] = flow [ property ] ; } } } self . f_function_flow . push ( new_flow_object ) ; } ) ; // Finaly, call user specified initializer and pass the instance options // custom data as the first argument if ( con_o . initializer ) { con_o . initializer . apply ( self , [ ins_o . custom_data ] ) ; } }
The constructor returned when getConstructor is called.
@TODO Module this, split split!
@constructor
@param {object} ins_o - Instance options
@example
new f_Constructor({ a: 'b' }) // { a: 'b' }
The constructor returned when getConstructor is called .