Class: Believe::Resources::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/believe/resources/stream.rb

Overview

Server-Sent Events (SSE) streaming endpoints

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Stream

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Stream.

Parameters:



28
29
30
# File 'lib/believe/resources/stream.rb', line 28

def initialize(client:)
  @client = client
end

Instance Method Details

#test_connection(request_options: {}) ⇒ Object

A simple SSE test endpoint that streams numbers 1-5.

Parameters:

Returns:

  • (Object)

See Also:



16
17
18
19
20
21
22
23
# File 'lib/believe/resources/stream.rb', line 16

def test_connection(params = {})
  @client.request(
    method: :get,
    path: "stream/test",
    model: ::Believe::Internal::Type::Unknown,
    options: params[:request_options]
  )
end