Sha256: ce8cc20741bd8bf6735b3f0a2fc403702d47081814fef8cf5a03f4b03835e3ad

Contents?: true

Size: 461 Bytes

Versions: 7

Compression:

Stored size: 461 Bytes

Contents

module Rack
  class BodyProxy
    def initialize(body, &block)
      @body, @block, @closed = body, block, false
    end

    def respond_to?(*args)
      super or @body.respond_to?(*args)
    end

    def close
      return if @closed
      @closed = true
      @body.close if @body.respond_to? :close
      @block.call
    end

    def closed?
      @closed
    end

    def method_missing(*args, &block)
      @body.__send__(*args, &block)
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.8/gems/rack-1.3.5/lib/rack/body_proxy.rb
candlepin-api-0.4.0 bundle/ruby/gems/rack-1.3.5/lib/rack/body_proxy.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/rack-1.3.5/lib/rack/body_proxy.rb
rack-1.4.0 lib/rack/body_proxy.rb
rack-1.3.6 lib/rack/body_proxy.rb
rack-1.3.5 lib/rack/body_proxy.rb
rack-1.3.4 lib/rack/body_proxy.rb