Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make extending Stream with mixins easier

  • Loading branch information...
commit 962d3f549ec6b7a2adbbee8438f03b28cdf80d6f 1 parent c236676
@rkh rkh authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/sinatra/base.rb
View
7 lib/sinatra/base.rb
@@ -243,9 +243,11 @@ def self.defer(*) yield end
def initialize(scheduler = self.class, close = true, &back)
@back, @scheduler, @callback, @close = back.to_proc, scheduler, nil, close
+ super()
end
def close
+ return super if defined? super
@scheduler.schedule { @callback.call if @callback }
end
@@ -267,10 +269,13 @@ def <<(data)
end
def callback(&block)
+ return super if defined? super
@callback = block
end
- alias errback callback
+ def errback
+ super if defined? super
+ end
end
# Allows to start sending data to the client even though later parts of
Please sign in to comment.
Something went wrong with that request. Please try again.