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-3.0.6 lib/jets/middleware/layer.rb
jets-3.0.5 lib/jets/middleware/layer.rb
jets-3.0.4 lib/jets/middleware/layer.rb
jets-3.0.3 lib/jets/middleware/layer.rb
jets-2.3.19 lib/jets/middleware/layer.rb
jets-3.0.2 lib/jets/middleware/layer.rb
jets-3.0.1 lib/jets/middleware/layer.rb
jets-3.0.0 lib/jets/middleware/layer.rb
jets-2.3.18 lib/jets/middleware/layer.rb
jets-2.3.17 lib/jets/middleware/layer.rb
jets-2.3.16 lib/jets/middleware/layer.rb
jets-2.3.15 lib/jets/middleware/layer.rb
jets-2.3.14 lib/jets/middleware/layer.rb
jets-2.3.13 lib/jets/middleware/layer.rb
jets-2.3.12 lib/jets/middleware/layer.rb
jets-2.3.11 lib/jets/middleware/layer.rb
jets-2.3.10 lib/jets/middleware/layer.rb
jets-2.3.9 lib/jets/middleware/layer.rb
jets-2.3.8 lib/jets/middleware/layer.rb
jets-2.3.7 lib/jets/middleware/layer.rb