File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,21 @@ class InvalidHeader < StandardError
5151 attr_accessor :reason_phrase
5252
5353 ##
54- # Body may be a String or IO-like object that responds to #read and
55- # #readpartial.
54+ # Body may be:
55+ # * a String;
56+ # * an IO-like object that responds to +#read+ and +#readpartial+;
57+ # * a Proc-like object that responds to +#call+.
58+ #
59+ # In the latter case, either #chunked= should be set to +true+,
60+ # or <code>header['content-length']</code> explicitly provided.
61+ # Example:
62+ #
63+ # server.mount_proc '/' do |req, res|
64+ # res.chunked = true
65+ # # or
66+ # # res.header['content-length'] = 10
67+ # res.body = proc { |out| out.write(Time.now.to_s) }
68+ # end
5669
5770 attr_accessor :body
5871
You can’t perform that action at this time.
0 commit comments