Class: Believe::Resources::PepTalk
- Inherits:
-
Object
- Object
- Believe::Resources::PepTalk
- Defined in:
- lib/believe/resources/pep_talk.rb
Overview
Server-Sent Events (SSE) streaming endpoints
Instance Method Summary collapse
-
#initialize(client:) ⇒ PepTalk
constructor
private
A new instance of PepTalk.
-
#retrieve(stream: nil, request_options: {}) ⇒ ::Believe::Models::PepTalkRetrieveResponse
Get a motivational pep talk from Ted Lasso himself.
Constructor Details
#initialize(client:) ⇒ PepTalk
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 PepTalk.
35 36 37 |
# File 'lib/believe/resources/pep_talk.rb', line 35 def initialize(client:) @client = client end |
Instance Method Details
#retrieve(stream: nil, request_options: {}) ⇒ ::Believe::Models::PepTalkRetrieveResponse
Get a motivational pep talk from Ted Lasso himself. By default returns the complete pep talk. Add ‘?stream=true` to get Server-Sent Events (SSE) streaming the pep talk chunk by chunk.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/believe/resources/pep_talk.rb', line 20 def retrieve(params = {}) parsed, = ::Believe::PepTalkRetrieveParams.dump_request(params) query = ::Believe::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "pep-talk", query: query, model: ::Believe::Models::PepTalkRetrieveResponse, options: ) end |