Sha256: 6da63864c5b59438720499c08d58a3481b8b76d748bf9994d6c1bb6ae009585b

Contents?: true

Size: 920 Bytes

Versions: 3

Compression:

Stored size: 920 Bytes

Contents

var
    StrategyContext;

// generic strategy factory
(function($module) {
    "use strict";

    Object.defineProperties($module, {
        StrategyContext: {
            value: {}
        }
    });

    Object.defineProperties(StrategyContext, {

        new: {
            // value: function(strategy, ...args) {
            value: function(strategy) {

                var
                    _strategy = strategy,
                    ConstructorReference = StrategyContext.new;

                if (!(this instanceof ConstructorReference)) {
                    return new ConstructorReference(strategy);
                }

                this.strategy = function(strategy) {
                    if (strategy) {
                        _strategy = strategy;
                    }

                    return _strategy;
                };

                return this;
            }
        }

    });

})(window);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
esphinx-rails-1.1.4 lib/assets/javascripts/esphinx/lib/patterns/gof/strategies/context.js
esphinx-rails-1.1.3 lib/assets/javascripts/esphinx/lib/patterns/gof/strategies/context.js
esphinx-rails-1.1.2 lib/assets/javascripts/esphinx/lib/patterns/gof/strategies/context.js