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:
parent
9696af84ac
commit
3be772f1a8
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue