Class: HTTTee::Server::ChunkedBody
Instance Method Summary
collapse
#<<, #each, #initialize
Instance Method Details
#call(body) ⇒ Object
4
5
6
7
8
|
# File 'lib/htttee/server/chunked_body.rb', line 4
def call(body)
body.each do |fragment|
@body_callback.call(chunk(fragment))
end
end
|
#chunk(fragment) ⇒ Object
15
16
17
|
# File 'lib/htttee/server/chunked_body.rb', line 15
def chunk(fragment)
"#{fragment.size.to_s(16)}\r\n#{fragment}\r\n"
end
|
#succeed(*a) ⇒ Object
10
11
12
13
|
# File 'lib/htttee/server/chunked_body.rb', line 10
def succeed(*a)
@body_callback.call("0\r\n\r\n")
super
end
|