Sha256: f386466127ee797e6416548760409d1358d59480ab0920e0c55ea6869a857830

Contents?: true

Size: 343 Bytes

Versions: 20

Compression:

Stored size: 343 Bytes

Contents

# encoding: utf-8

# Internal: Adds the requested resource to rack's env
module Hyperdrive
  module Middleware
    class Resource
      def initialize(app, resource)
        @app = app
        @resource = resource
      end

      def call(env)
        env['hyperdrive.resource'] = @resource
        @app.call(env)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hyperdrive-0.0.25 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.24 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.23 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.22 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.21 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.20 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.19 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.18 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.17 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.16 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.15 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.14 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.13 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.12 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.11 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.10 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.9 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.8 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.7 lib/hyperdrive/middleware/resource.rb
hyperdrive-0.0.6 lib/hyperdrive/middleware/resource.rb