Class: EasyLlama::Client::Trainings

Inherits:
Api
  • Object
show all
Defined in:
lib/easyllama/trainings.rb

Overview

This class provides methods for interacting with the Easy Llama API for trainings.

Constant Summary

Constants inherited from Api

Api::DEFAULT_API_VERSION, Api::DEFAULT_URI_BASE

Instance Method Summary collapse

Methods inherited from Api

#initialize, #parse_response!, #send_request

Constructor Details

This class inherits a constructor from EasyLlama::Client::Api

Instance Method Details

#all(page: 1) ⇒ Array

Sends a GET request to retrieve all trainings.

Parameters:

  • page (Integer) (defaults to: 1)

    The page number.

Returns:

  • (Array)

    The trainings or an error message.



11
12
13
14
15
# File 'lib/easyllama/trainings.rb', line 11

def all(page: 1)
  response = send_request(path: '/trainings', body: { page: })

  parse_response!(response, 'trainings')
end