fluminus v2.0.2 Fluminus.API.Module View Source

Provides an abstraction over a module in LumiNUS, and operations possible on the module using LumiNUS API.

Struct fields:

  • :id - id of the module in the LumiNUS API
  • :code - code of the module, e.g. "CS1101S"
  • :name - name of the module, e.g. "Programming Methodology"
  • :teaching? - true if the user is teaching the module, false if the user is taking the module
  • :term - a string identifier used by the LumiNUS API to uniquely identify a term (semester), e.g. "1820" is invalid

Link to this section Summary

Functions

Returns a list of announcements for a given module.

Creates Elixir.Fluminus.API.Module struct from LumiNUS API response.

Get all the lesson plans associated with this Module.

Get all the weblectures associated with this Module.

Link to this section Types

Specs

t() :: %Fluminus.API.Module{
  code: String.t(),
  id: String.t(),
  name: String.t(),
  teaching?: bool(),
  term: String.t()
}

Link to this section Functions

Link to this function

announcements(module, auth, archived \\ false)

View Source

Specs

announcements(t(), Fluminus.Authorization.t(), bool()) ::
  {:ok, [%{title: String.t(), description: String.t(), datetime: DateTime.t()}]}
  | {:error, any()}

Returns a list of announcements for a given module.

The LumiNUS API provides 2 separate endpoints for archived and non-archived announcements. By default, announcements are archived after roughly 16 weeks (hence, the end of the semester) so most of the times, we should never need to access archived announcements.

Specs

from_api(any()) :: {:ok, t()} | :error

Creates Elixir.Fluminus.API.Module struct from LumiNUS API response.

Specs

lessons(t(), Fluminus.Authorization.t()) ::
  {:ok, [Fluminus.API.Module.Lesson.t()]} | {:error, any()}

Get all the lesson plans associated with this Module.

Link to this function

weblectures(module, auth)

View Source

Specs

weblectures(t(), Fluminus.Authorization.t()) ::
  {:ok, [String.t()]} | {:error, any()}

Get all the weblectures associated with this Module.