-
Notifications
You must be signed in to change notification settings - Fork 0
Code Documentation
Returns the base URL for the OpenMensa API.
Returns the postfix URL for fetching meals, with placeholders for canteen ID and date.
Fetches the meals from openmensa.org
for a specified canteen on a specified date. Both parameters should be strings, and the date needs to be formatted as 'YYYY-MM-DD'. The return type is a JSON string.
Tests the API call with an invalid URL. Asserts that the response is empty or an network error occurred.
Tests the API call with a valid URL. Asserts that the response from 'MWApiWrapper' matches the expected content from the unwrapped call or an network error occurred.
Translates the Dataset into a Json or multiple Jsons and reads the information provided into the instance of a given class. The function returns a list of instances of the provided class, as many as there are valid Json objects in the Dataset.
Sets a desired instance variable on any class instance from a dataset. If no data is provided for the given instance variable, nil
ist the default value.
It tests that the MWParser
puts nil
in the instance variable fields that no data is provided for.
It tests that the MWParser
puts the correct values into the instance variables if data is provided.
It tests that the MWParser
ignores any additional properties in datasets.
It tests that the MWParser
correctly returns two class instances with the correct instance variables for multiple provided JSON objects.
It tests that the MWParser
correctly returns a class instance with the values provided by the data put into the instance variables.
Returns a dictionary with canteen id strings as keys and corresponding canteen name strings as values.
Returns a Collection of CanteenObjects that are filled in with id, name, date and meals using the date of today and all in the dict, that is stored classside, canteenids. It works by unsing the MWParser and MWApiWrapper look there for more documentation.
Returns a Collection of CanteenObjects that are filled in with id, name, date and meals using the date that is given to the function in the dict, that is stored classside, canteenids. It works by unsing the MWParser and MWApiWrapper look there for more documentation.
It test that the Collection returned by todaysMeals is equal to the size of the keys in the dict stored classside.
It test that all objects in the Collection returned by todaysMeals are of the MWCanteen class.
It test that all objects in the Collection returned by todaysMeals have data filled in an no field is nil.
This is a method that initializes the Mensa Widget label in the Apps menu. It also opens the widget.
This is a method that allows on instance creation assembling all the neccesary parts.
It assembles all parts of the frame itself providing position, extend and other important information.
This adds a TextMorph displaying the text Lunchtime as a placeholder for the actual meal information and adds it as PaneMorph.
Tests that the Frame has Panemorphs, to make sure it has some sort of content.
Tests that the Frame as a class is the subclass of a PluggableSystemWindow as it sould be.
Tests that the Frame has the right title, being "Mensa Widget".
Tests the Frame one two things. First it test that is has been opened in the world and therefore visible. Secondly it test that it is opened and not collapsed on the side.
Tests that the Frame is not bigger initialy than the world it is in.
The category is a String correlating to the meal category provided by the endpoint.
The ID is a number correlating to the ID provided by the endpoint.
The name is a String correlating to the provided name by the endpoint.
The notes are an ordered collection of additional info provided by the endpoint.
The prices are a JSON object storing the prices for students, employees, pupils and others provided by the endpoint.
The canteen id as a string correlation to the id at the endpoint.
The canteen name in german.
The date where the following meals for this canteen are available as a string in the format yyyy-mm-dd.
A OrderedCollection of meals that are available aat the specified day at this canteen.
Returns a Color that is meant to be the primary color of the widget.
Returns a Color that is meant to be the secondary color of the widget.
Returns a Color that is meant to be the background color of the widget.
Returns a Color that is meant to be the transparent color of the widget.
Given a Event stamming from a button click the date will be updated and the menus newly rendered for the previous day. Also the button will give visual feedback by changing color for that duration.
Given a Event stamming from a button click the date will be updated and the menus newly rendered for the following day. Also the button will give visual feedback by changing color for that duration.
The date display that is showing the user its date will update to the date stored in the instance variable and also the target being the window the MenuBar belongs to will display the meals for the day being shown.