mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/webrick] Document HTTPResponse#body callable option
https://github.com/ruby/webrick/commit/d51836d03d
This commit is contained in:
parent
ea4272d02b
commit
f7cf5416e4
1 changed files with 15 additions and 2 deletions
|
@ -51,8 +51,21 @@ module WEBrick
|
|||
attr_accessor :reason_phrase
|
||||
|
||||
##
|
||||
# Body may be a String or IO-like object that responds to #read and
|
||||
# #readpartial.
|
||||
# Body may be:
|
||||
# * a String;
|
||||
# * an IO-like object that responds to +#read+ and +#readpartial+;
|
||||
# * a Proc-like object that responds to +#call+.
|
||||
#
|
||||
# In the latter case, either #chunked= should be set to +true+,
|
||||
# or <code>header['content-length']</code> explicitly provided.
|
||||
# Example:
|
||||
#
|
||||
# server.mount_proc '/' do |req, res|
|
||||
# res.chunked = true
|
||||
# # or
|
||||
# # res.header['content-length'] = 10
|
||||
# res.body = proc { |out| out.write(Time.now.to_s) }
|
||||
# end
|
||||
|
||||
attr_accessor :body
|
||||
|
||||
|
|
Loading…
Reference in a new issue