/**
* Adds static data to API response
*
* Copyright (C) 2016, 2018 R-T Specialty, LLC.
*
* This file is part of the Liza Data Collection Framework
*
* liza is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
var Class = require( 'easejs' ).Class,
DataApi = require( './DataApi' ),
EventEmitter = require( 'events' ).EventEmitter;
/**
* Prepends static data to a response
*/
module.exports = Class( 'StaticAdditionDataApi' )
.implement( DataApi )
.extend( EventEmitter,
{
/**
* DataApi to restrict
* @type {DataApi}
*/
'private _api': null,
/**
* Prevents augmenting empty sets
* @type {boolean}
*/
'private _nonempty': false,
/**
* Only append if more than 1 result
* @type {boolean}
*/
'private _multiple': false,
/**
* Static values to prepend
*/
'private _static': [],
/**
* Initialize static API response data
*
* @param {DataApi} data_api data API to wrap
* @param {Boolean} nonempty to append if any results
* @param {Boolean} multiple to append if more than 1 result
* @param {Array.