Class: Believe::Resources::Press

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

Overview

Interactive endpoints for motivation and guidance

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Press

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 Press.

Parameters:



36
37
38
# File 'lib/believe/resources/press.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#simulate(question:, hostile: nil, topic: nil, request_options: {}) ⇒ ::Believe::Models::PressSimulateResponse

Get Ted’s response to press conference questions.

Parameters:

  • question (String)

    The press question to answer

  • hostile (Boolean)

    Is this a hostile question from Trent Crimm?

  • topic (String, nil)

    Topic category

  • request_options (::Believe::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/believe/resources/press.rb', line 22

def simulate(params)
  parsed, options = ::Believe::PressSimulateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "press",
    body: parsed,
    model: ::Believe::Models::PressSimulateResponse,
    options: options
  )
end