'use strict';

// Load modules

const Joi = require('joi');
const Request = require('./request');
const Response = require('./response');
const Schema = require('./schema');

exports.inject = function (dispatchFunc, options, callback) {

    Joi.assert({
        dispatchFunc: dispatchFunc,
        options: options,
        callback: callback
    }, Schema);

    const req = new Request(options);
    const res = new Response(req, callback);

    return req.prepare(() => dispatchFunc(req, res));
};


exports.isInjection = function (obj) {

    return (obj instanceof Request || obj instanceof Response);
};

@@ -251,61 +251,22 @@
 rt(%7B
-%0A        dispatchFunc: dispatchFunc,%0A        options:
+ dispatchFunc,
  opt
@@ -274,16 +274,8 @@
 ons,
-%0A       
  cal
@@ -283,22 +283,8 @@
 back
-: callback%0A   
  %7D, 

use the nicer single variable name object syntax