shyftplan-ruby

Ruby gem for Shyftplan's REST API https://github.com/shyftplan/api-documentation

Try the gem on repl.it https://replit.com/@nisanth074/tryshyftplanruby#main.rb

Installation

Add the gem to your Rails app's Gemfile

gem "shyftplan", git: "https://github.com/nisanth074/shyftplan-ruby", branch: "main"

and bundle install

bundle install

Usage

Initialize the Shyftplan client

shyftplan = Shyftplan.new("[email protected]", "dummy_api_token")

Retrieve evaluations

response = shyftplan.get("/evaluations")
evaluations = response["items"]

Retrieve evaluations across all pages

evaluations = shyftplan.each_page("/evaluations")

Doing the above may take a while. If you'd like to perform any action after each page retrieval, provide a block

shyftplan.each_page("/evaluations") do |page|
  puts "Page retrieved..."

  evaluations = page["items"]
  EvaluationsCSVExport.add(evaluations)
end

Todos