Class: Believe::Resources::Coaching::Principles

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

Overview

Interactive endpoints for motivation and guidance

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Principles

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

Parameters:



74
75
76
# File 'lib/believe/resources/coaching/principles.rb', line 74

def initialize(client:)
  @client = client
end

Instance Method Details

#get_random(request_options: {}) ⇒ ::Believe::Models::Coaching::CoachingPrinciple

Get a random coaching principle to inspire your day.

Parameters:

Returns:

See Also:



62
63
64
65
66
67
68
69
# File 'lib/believe/resources/coaching/principles.rb', line 62

def get_random(params = {})
  @client.request(
    method: :get,
    path: "coaching/principles/random",
    model: ::Believe::Coaching::CoachingPrinciple,
    options: params[:request_options]
  )
end

#list(limit: nil, skip: nil, request_options: {}) ⇒ ::Believe::Internal::SkipLimitPage<::Believe::Models::Coaching::CoachingPrinciple>

Get a paginated list of Ted Lasso’s core coaching principles and philosophy.

Parameters:

  • limit (Integer)

    Maximum number of items to return (max: 100)

  • skip (Integer)

    Number of items to skip (offset)

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

Returns:

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/believe/resources/coaching/principles.rb', line 40

def list(params = {})
  parsed, options = ::Believe::Coaching::PrincipleListParams.dump_request(params)
  query = ::Believe::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "coaching/principles",
    query: query,
    page: ::Believe::Internal::SkipLimitPage,
    model: ::Believe::Coaching::CoachingPrinciple,
    options: options
  )
end

#retrieve(principle_id, request_options: {}) ⇒ ::Believe::Models::Coaching::CoachingPrinciple

Get details about a specific coaching principle.

Parameters:

Returns:

See Also:



18
19
20
21
22
23
24
25
# File 'lib/believe/resources/coaching/principles.rb', line 18

def retrieve(principle_id, params = {})
  @client.request(
    method: :get,
    path: ["coaching/principles/%1$s", principle_id],
    model: ::Believe::Coaching::CoachingPrinciple,
    options: params[:request_options]
  )
end