fluminus v0.1.1 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"
:valid?
- whether the struct should be considered valid.false
if the parameter toElixir.Fluminus.API.Module.from_api/1
is invalid
Link to this section Summary
Functions
Returns a list of {announcement_title, announcement_content}
for a given module
Creates Elixir.Fluminus.API.Module
struct from LumiNUS API response
Link to this section Types
Link to this section Functions
Link to this function
announcements(module, auth, archived \\ false)
View Source
announcements(module, auth, archived \\ false)
View Source
announcements(Fluminus.API.Module.t(), Fluminus.Authorization.t(), bool()) :: [
{String.t(), String.t()}
]
announcements(Fluminus.API.Module.t(), Fluminus.Authorization.t(), bool()) :: [ {String.t(), String.t()} ]
Returns a list of {announcement_title, announcement_content}
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.
Link to this function
from_api(api_response)
View Source
from_api(api_response)
View Source
from_api(any()) :: Fluminus.API.Module.t()
from_api(any()) :: Fluminus.API.Module.t()
Creates Elixir.Fluminus.API.Module
struct from LumiNUS API response.