Class: RubstApi::StreamingResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/rubst_api/responses.rb

Direct Known Subclasses

EventSourceResponse, FileResponse

Instance Attribute Summary

Attributes inherited from Response

#body, #headers, #media_type, #status_code

Instance Method Summary collapse

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, **options)
  super("", **options)
  @body = content.respond_to?(:each) ? content : [content]
end

Instance Method Details

#finishObject



49
# File 'lib/rubst_api/responses.rb', line 49

def finish = [status_code, headers.to_h, body]