class Rack::Lint::Wrapper
def to_ary
# +to_ary+ and +close+, its implementation of +to_ary+ must call
# Body directly if it responds to +to_ary+. If the Body responds to both
# Body in its place. In other words, middleware can only process the
# Middleware may call +to_ary+ directly on the Body and return a new
# contents are identical to that produced by calling +each+.
# If the Body responds to +to_ary+, it must return an +Array+ whose
#
def to_ary @body.to_ary.tap do |content| unless content == @body.enum_for.to_a raise LintError, "#to_ary not identical to contents produced by calling #each" end end ensure close end