Project

untis

0.0
No commit activity in last 3 years
No release in over 3 years
WebUntis Timetable Management system wrapper for Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Untis.rb

A Ruby-based WebUntis API wrapper for Untis Timetable Management System. Can be used with Rails.

Installation

In your terminal:

gem install untis

or Gemfile:

gem 'untis'

Then require it and authenticate where you need to:

require 'untis'

::Untis = UntisWorker.new login: 'some_user', password: 'password', school_name: 'Super School'
Untis.authenticate!

The wrapper will maintain a living session to WebUntis API. If the session expires, it will automatically attempt to negotiate a new session until it succeeds.

Usage

The library returns raw parsed JSON as string-indexed Hash, exactly how it is being returned by the WebUntis API. Example:

irb(main):001:0> Untis.get_teachers
=> {"jsonrpc"=>"2.0", "id"=>"3fa2785bdee9e601a0b038b79fdce10c", "result"=>[{"id"=>1, "name"=>"BA", "foreName"=>"Foo", "longName"=>"Bar", "title"=>"", "active"=>true, "dids"=>[]}]}

You can pass arguments to every single function as snake_case and in English, instead of the weird German/English mix, the wrapper will auto-translate your input into proper fields when it sends the request to the WebUntis API.

The wrapper does not do any permission checks, so be careful when using the API, since it may return error codes of it's own that the wrapper does not handle. If an error is returned by WebUntis API, it will simply be passed as return value, which you can then handle yourself. The wrapper does not raise any exceptions.

You can also use Hashie::Mash if you so wish in order to be able to access API return values like methods.

Further documentation

RubyDoc Documentation is available here.