src/validation.js
function( methodStr ){
    var parts = methodStr.split('['),
        definition = {
            name: parts[0],
            args: []
        },
        args
    ;

    if( parts.length > 1 ){
        args = parts[1];

        if( args[ args.length - 1 ] == ']' )
            args = args.slice(0, args.length - 1);

        definition.args = args.split(/\s*,\s*/);
    }

    return definition;
}
function( methodStr ){
    var parts = methodStr.split('['),
        definition = {
            name: parts[0],
            args: []
        },
        args
    ;

    if( parts.length > 1 ){
        args = parts[1];

        if( args[ args.length - 1 ] == ']' )
            args = args.slice(0, args.length - 1);

        definition.args = args.split(/\s*,\s*/);
    }

    return definition;
}
function ( methodStr ) { var parts = methodStr . split ( '[' ) , definition = { name : parts [ 0 ] , args : [ ] } , args ; if ( parts . length > 1 ) { args = parts [ 1 ] ; if ( args [ args . length - 1 ] == ']' ) args = args . slice ( 0 , args . length - 1 ) ; definition . args = args . split ( / \s*,\s* / ) ; } return definition ; }
Parse a method call in the data-validation attribute.
@param  {String} methodStr A method call like method[arg1, arg2, ...]
@return {Object}           An object like {name: 'method', args: [arg1, arg2, ...]}
Parse a method call in the data - validation attribute .