-
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.
This function 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 a 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 a 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
is the default value.
It tests that the MWParser
puts nil
in the instance variable fields for which no data is provided.
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 filled in with id, name, date, and meals using the date of today and all in the dictionary, that is stored classside, canteenids. It works by unsing the MWParser and MWApiWrapper look there for more documentation.
Returns a Collection of CanteenObjects 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 tests that the Collection returned by todaysMeals is equal to the size of the keys in the dictionary stored classside.
It tests that all objects in the Collection returned by todaysMeals are of the MWCanteen class.
It tests that all objects in the Collection returned by todaysMeals have data filled in, and no field is nil.
This method initializes the Mensa Widget label in the Apps menu and opens the widget.
This is a method that allows instance creation, assembling all the necessary parts.
It assembles all parts of the frame itself, providing position, extent, 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 should be.
Tests that the Frame has the right title, "Mensa Widget."
Tests the Frame one two things. First, it tests that it has been opened in the world and is, therefore, visible. Secondly, it tests that it is opened and not collapsed on the side.
Tests that the Frame is not bigger initially 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 JSON objects that store the prices for students, employees, pupils, and others provided by the endpoint.
The canteen ID is a string correlating to the ID at the endpoint.
The canteen's name in German.
The date when the following meals for this canteen are available as a string in the format yyyy-mm-dd.
An OrderedCollection of meals that are available at 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 an event stemming 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 an event stemming from a button click, the date will be updated, and the menus will be newly rendered for the following day. Also, the button will give visual feedback by changing color for that duration.
The date display that shows 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.
This method takes a Meal list as input and executes several cleanings for every meal in this list, according to hard-filtered errors within one meal.