Class: Rack::ContentLengthWithExclusions

Inherits:
ContentLength
  • Object
show all
Defined in:
lib/streamlog/content_length_with_exclusions.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ ContentLengthWithExclusions

Returns a new instance of ContentLengthWithExclusions.



3
4
5
6
7
# File 'lib/streamlog/content_length_with_exclusions.rb', line 3

def initialize(app, options = {})
  @app = app

  @exclude = options[:exclude]
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/streamlog/content_length_with_exclusions.rb', line 9

def call(env)
  if @exclude && @exclude.call(env)
    @app.call(env)
  else
    super(env)
  end
end