Class: Lattice::Employees

Inherits:
Client
  • Object
show all
Defined in:
lib/lattice/employees.rb

Constant Summary

Constants inherited from Client

Client::BASE_URL, Client::TOKEN_URL

Class Method Summary collapse

Methods inherited from Client

access_token, build_url, get, headers, paginated_get

Class Method Details

.allArray<Hash>

Retrieves a list of all employees from Lattice.

Examples:

employees = Lattice::Employees.all``
puts employees.first["name"]

Returns:

  • (Array<Hash>)

    An array of employee data hashes.



13
14
15
# File 'lib/lattice/employees.rb', line 13

def self.all
  paginated_get("/employees")
end

.find(id) ⇒ Hash

Retrieves a specific employee’s details from Lattice by their ID.

Examples:

employee = Lattice::Employees.find(123)
puts employee["personal"]

Parameters:

  • id (String, Integer)

    The unique identifier of the employee.

Returns:

  • (Hash)

    A hash containing the employee’s data.



24
25
26
# File 'lib/lattice/employees.rb', line 24

def self.find(id)
  get("/employees/#{id}")["data"]
end