Class: RubstApi::StreamingResponse
- Defined in:
- lib/rubst_api/responses.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Response
#body, #headers, #media_type, #status_code
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(content, **options) ⇒ StreamingResponse
constructor
A new instance of StreamingResponse.
Methods inherited from Response
#delete_cookie, #render, #set_cookie
Constructor Details
#initialize(content, **options) ⇒ StreamingResponse
Returns a new instance of StreamingResponse.
45 46 47 48 |
# File 'lib/rubst_api/responses.rb', line 45 def initialize(content, **) super("", **) @body = content.respond_to?(:each) ? content : [content] end |
Instance Method Details
#finish ⇒ Object
49 |
# File 'lib/rubst_api/responses.rb', line 49 def finish = [status_code, headers.to_h, body] |