Class: Versafleet::RunsheetsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/versafleet/resources/runsheets.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Versafleet::Resource

Instance Method Details

#drivers_tasks(driver_id:, **params) ⇒ Runsheet

View Driver Info and related Tasks

Examples:

client.runsheets.drivers_tasks(driver_id: 1)
# filter runsheets by date
client.runsheets.drivers_tasks(driver_id: 1, date: "2021-10-14")
# filter by date and state of the tasks
client.runsheets.drivers_tasks(driver_id: 1, date: "2021-10-14", state: "successful")

VersaFleet API

Parameters:

  • driver_id (Integer)

    Driver ID

  • params (Hash)

    the filter query

Returns:



18
19
20
# File 'lib/versafleet/resources/runsheets.rb', line 18

def drivers_tasks(driver_id:, **params)
  Runsheet.new get_request("runsheets/drivers/#{driver_id}", params: params).body.dig("driver")
end