src/back/models/methods.js
function _addMethod(methodDictionary, func, name) {
  expect(func).to.be.a(
    'function',
    'Invalid argument "func" when adding a method called "' + name + '" in a ' +
    'MethodDictionary (it has to be a function)'
  );

  Object.defineProperty(methodDictionary, name, {
    value: func,
    enumerable: true,
    writable: false,
    configurable: false
  });
}
function _addMethod(methodDictionary, func, name) {
  expect(func).to.be.a(
    'function',
    'Invalid argument "func" when adding a method called "' + name + '" in a ' +
    'MethodDictionary (it has to be a function)'
  );

  Object.defineProperty(methodDictionary, name, {
    value: func,
    enumerable: true,
    writable: false,
    configurable: false
  });
}
function _addMethod ( methodDictionary , func , name ) { expect ( func ) . to . be . a ( 'function' , 'Invalid argument "func" when adding a method called "' + name + '" in a ' + 'MethodDictionary (it has to be a function)' ) ; Object . defineProperty ( methodDictionary , name , { value : func , enumerable : true , writable : false , configurable : false } ) ; }
Adds a new method to the dictionary.
@name module:back4app-entity/models/methods~_addMethod
@function
@param {!module:back4app-entity/models/methods.MethodDictionary}
methodDictionary This is the MethodDictionary instance to which the method
will be added.
@param {!function} func This is the method's function to be added.
@param {!string} name This is the name of the method.
@private
@example
MethodDictionary.add(
methodDictionary,
function () { return 'method3'; },
'method3'
);
Adds a new method to the dictionary .