lib/startable-model.js
function StartableModel(model,instance) {
    if(!model) {
        throw new Error('model is required')
    }
    if(!instance) {
        throw new Error('instance is required')
    }
    if(!(this instanceof StartableModel)) {
        return new StartableModel(model,instance,index)
    }
    this.model = model
    this.key = model.key
    this.instance= instance
    this.fn = instance[model.startable]
    if(!this.fn) {
        throw new Error('The instance of ' +
                        this.key +
                        ' does not have a method ' +
                        model.startable +
                       ' which is required for starting this service.')
    }
    this.inject = (this.fn.inject || [])
    this.hasDeps = (this.inject.length > 0)
}
function StartableModel(model,instance) {
    if(!model) {
        throw new Error('model is required')
    }
    if(!instance) {
        throw new Error('instance is required')
    }
    if(!(this instanceof StartableModel)) {
        return new StartableModel(model,instance,index)
    }
    this.model = model
    this.key = model.key
    this.instance= instance
    this.fn = instance[model.startable]
    if(!this.fn) {
        throw new Error('The instance of ' +
                        this.key +
                        ' does not have a method ' +
                        model.startable +
                       ' which is required for starting this service.')
    }
    this.inject = (this.fn.inject || [])
    this.hasDeps = (this.inject.length > 0)
}
function StartableModel ( model , instance ) { if ( ! model ) { throw new Error ( 'model is required' ) } if ( ! instance ) { throw new Error ( 'instance is required' ) } if ( ! ( this instanceof StartableModel ) ) { return new StartableModel ( model , instance , index ) } this . model = model this . key = model . key this . instance = instance this . fn = instance [ model . startable ] if ( ! this . fn ) { throw new Error ( 'The instance of ' + this . key + ' does not have a method ' + model . startable + ' which is required for starting this service.' ) } this . inject = ( this . fn . inject || [ ] ) this . hasDeps = ( this . inject . length > 0 ) }
Encapsulate a startable function description
@class StartableModel
Encapsulate a startable function description