Sha256: eb85be06385564d768f9a49a8a0514784b88f492f8c985792b2911b16bf4b4e9

Contents?: true

Size: 569 Bytes

Versions: 191

Compression:

Stored size: 569 Bytes

Contents

module Jets::Middleware
  class Layer
    attr_reader :args, :block, :klass

    def initialize(klass, args, block)
      @klass = klass
      @args  = args
      @block = block
    end

    def name; klass.name; end

    def ==(middleware)
      case middleware
      when Layer
        klass == middleware.klass
      when Class
        klass == middleware
      end
    end

    def inspect
      if klass.is_a?(Class)
        klass.to_s
      else
        klass.class.to_s
      end
    end

    def build(app)
      klass.new(app, *args, &block)
    end
  end
end

Version data entries

191 entries across 191 versions & 4 rubygems

Version Path
jets-4.0.12 lib/jets/middleware/layer.rb
jets-4.0.11 lib/jets/middleware/layer.rb
jets-4.0.10 lib/jets/middleware/layer.rb
jets-4.0.9 lib/jets/middleware/layer.rb
jets-4.0.8 lib/jets/middleware/layer.rb
jets-4.0.7 lib/jets/middleware/layer.rb
jets-4.0.6 lib/jets/middleware/layer.rb
jets-4.0.5 lib/jets/middleware/layer.rb
jets-4.0.4 lib/jets/middleware/layer.rb
jets-4.0.3 lib/jets/middleware/layer.rb
jets-4.0.2 lib/jets/middleware/layer.rb
jets-4.0.1 lib/jets/middleware/layer.rb
jets-4.0.0 lib/jets/middleware/layer.rb
jets-3.2.2 lib/jets/middleware/layer.rb
jets-3.2.1 lib/jets/middleware/layer.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/middleware/layer.rb
jets-3.2.0 lib/jets/middleware/layer.rb
jets-3.1.5 lib/jets/middleware/layer.rb
jets-3.1.4 lib/jets/middleware/layer.rb
jets-3.1.3 lib/jets/middleware/layer.rb