1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Use Stream#closed? if it's already defined.

This commit is contained in:
Damir Svrtan 2014-06-20 16:09:39 +02:00
parent 9696af84ac
commit 3be772f1a8

View file

@ -391,7 +391,7 @@ module Sinatra
end
def close
return if @closed
return if closed?
@closed = true
@scheduler.schedule { @callbacks.each { |c| c.call }}
end
@ -414,7 +414,7 @@ module Sinatra
end
def callback(&block)
return yield if @closed
return yield if closed?
@callbacks << block
end