From fefe2dae4117b06960186349d65c62dac2d458a7 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 11 Apr 2016 11:48:58 -0400 Subject: [PATCH] Remove ClientFieldValidator#monitor * src/validate/ClientFieldValidator.js (monitor): Remove This just concerns itself with something that it should be concerned about; let the caller handle monitoring, now that we have a #validate method. --- src/validate/ClientFieldValidator.js | 36 +--------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/src/validate/ClientFieldValidator.js b/src/validate/ClientFieldValidator.js index 5d048df..d14afb3 100644 --- a/src/validate/ClientFieldValidator.js +++ b/src/validate/ClientFieldValidator.js @@ -17,20 +17,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * @needsLove - * - Liberate QuoteClient - * @end needsLove */ var Class = require( 'easejs' ).Class, - QuoteClient = require( 'program/QuoteClient' ), EventEmitter = require( 'events' ).EventEmitter; /** - * Passively monitors quote data, validating and formatting any fields that are - * altered for the given QuoteClient + * Validate and format altered fields * * In the event of a validation failure, the data will not be added to the * bucket and the caller may be notified via a failure callback. This way, you @@ -64,34 +58,6 @@ module.exports = Class( 'ClientFieldValidator' ) }, - /** - * Monitor the given QUOTE_CLIENT for field changes and trigger validation * - * - * @param {QuoteClient} quote_client quote client to validate against - * - * @param {function(Object)} failure_callback function to call with errors - * @param {function(Object)} fix_callback function to call with indexes - * of fields that have previously - * failed, but have since been - * resolved - * - * @return {ClientFieldValidator} self - */ - 'public monitor': function( quote_client, failure_callback, fix_callback ) - { - var _self = this; - - // catch problems *before* the data is staged, altering the data - // directly if need be - quote_client.on( 'preDataUpdate', function( data ) - { - _self.validate( data, failure_callback, fix_callback ); - } ); - - return this; - }, - - /** * Perform field validation *